Skip to content

Commit

Permalink
--
Browse files Browse the repository at this point in the history
  • Loading branch information
devansh-singh2351 committed Nov 29, 2024
1 parent f547a99 commit f898716
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 68 deletions.
26 changes: 11 additions & 15 deletions modules/swagger-codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,25 +200,21 @@
<swagger-codegen-v2-version>2.4.43</swagger-codegen-v2-version>
</properties>
<dependencies>
<!-- <dependency>-->
<!-- <groupId>io.swagger</groupId>-->
<!-- <artifactId>swagger-parser</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser</artifactId>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen</artifactId>
<version>${swagger-codegen-v2-version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.swagger</groupId>-->
<!-- <artifactId>swagger-codegen</artifactId>-->
<!-- <version>${swagger-codegen-v2-version}</version>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <groupId>org.slf4j</groupId>-->
<!-- <artifactId>slf4j-simple</artifactId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->
<dependency>
<groupId>com.samskivert</groupId>
<artifactId>jmustache</artifactId>
Expand Down
46 changes: 23 additions & 23 deletions modules/swagger-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -294,29 +294,29 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-inflector</artifactId>
<version>${inflector-version}</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
</exclusion>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</exclusion>
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.swagger</groupId>-->
<!-- <artifactId>swagger-inflector</artifactId>-->
<!-- <version>${inflector-version}</version>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <groupId>org.codehaus.woodstox</groupId>-->
<!-- <artifactId>woodstox-core-asl</artifactId>-->
<!-- </exclusion>-->
<!-- <exclusion>-->
<!-- <groupId>javax.activation</groupId>-->
<!-- <artifactId>activation</artifactId>-->
<!-- </exclusion>-->
<!-- <exclusion>-->
<!-- <groupId>javax.xml.bind</groupId>-->
<!-- <artifactId>jaxb-api</artifactId>-->
<!-- </exclusion>-->
<!-- <exclusion>-->
<!-- <groupId>javax.inject</groupId>-->
<!-- <artifactId>javax.inject</artifactId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
Expand Down
10 changes: 5 additions & 5 deletions pom.docker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -935,11 +935,11 @@
<version>${swagger-core-version-v1}</version>
</dependency>
<!-- swagger-parser v2 -->
<dependency>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser</artifactId>
<version>${swagger-parser-version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.swagger.parser.v3</groupId>-->
<!-- <artifactId>swagger-parser</artifactId>-->
<!-- <version>${swagger-parser-version}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser-core</artifactId>
Expand Down
35 changes: 10 additions & 25 deletions swagger_sdk_gen_v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,16 @@ curl -k $version -o config.json
echo "GENERATING SDK"
if [ "$Client" = "java" ]
then
echo "Removing existing Java client SDK..."
rm -rf intouch_api/java_client/java

# Step 2: Generate the SDK using OpenAPI Generator (via Docker)
echo "Generating SDK using OpenAPI Generator..."
docker run --rm -v $(pwd):/local -e url=$url openapitools/openapi-generator-cli generate \
-i $url \
-g java \
-p dateLibrary=java8 \
-o intouch_api/java_client/java
# Step 3: Create a .tar.gz archive of the generated SDK
echo "Creating .tar.gz archive..."
tar cvzf intouch_api/java_client/java_swagger_sdk_$BUILD_NUMBER.tar.gz -C ./intouch_api/java_client/java/ .

# Step 4: Deploy the SDK using Maven
echo "Deploying SDK using Maven..."
mvn3 clean deploy -f intouch_api/java_client/java/pom.xml
# Step 5: Create a .deb package using fpm
echo "Creating .deb package using fpm..."
fpm -f -s "dir" -t "deb" -a "all" -n "java-swagger-v3-sdk" -v $BUILD_NUMBER \
-C ./intouch_api/java_client \
--deb-no-default-config-files \
java="/usr/share/java/capillary-libs/swagger-v3-sdk"

echo "Build and deployment completed successfully."
rm -rf intouch_api/java_client/java
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i $url \
-l java \
-DdateLibrary=java8 \
-o intouch_api/java_client/java \
-c config.json
tar cvzf intouch_api/java_client/java_swagger_sdk_$BUILD_NUMBER.tar.gz -C ./intouch_api/java_client/java/ .
mvn3 clean deploy -f intouch_api/java_client/java/pom.xml
fpm -f -s "dir" -t "deb" -a "all" -n "java-swagger-v3-sdk" -v $BUILD_NUMBER -C ./intouch_api/java_client --deb-no-default-config-files java="/usr/share/java/capillary-libs/swagger-v3-sdk"

elif [ "$Client" = "c#" ]
then rm -rf intouch_api/csharp_client/c#
Expand Down

0 comments on commit f898716

Please sign in to comment.