Skip to content

Commit

Permalink
Address review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
TharmiganK committed Apr 23, 2024
1 parent 5491a60 commit b32c1ac
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ apply plugin: "org.javamodularity.moduleplugin"
apply from: "$rootDir/gradle/javaProject.gradle"

ext.clientNativeVersion = project.clientNativeVersion
ext.skipClientNativePublish = project.skipClientNativePublish
ext.clientNativePublish = project.clientNativePublish
ext.ballerinaLangVersion = project.ballerinaLangVersion
ext.testngVersion = project.testngVersion
ext.commonsLang3Version = project.commonsLang3Version
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ version=1.9.0-SNAPSHOT

# Client Native Version
clientNativeVersion=1.0.0-SNAPSHOT
# Mark this as true to skip publishing the client native artifacts
skipClientNativePublish=false
# Mark this as false to skip publishing the client native artifacts
clientNativePublish=true

#dependency
ballerinaLangVersion=2201.9.0-20240419-152500-bd530dd2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,16 +466,14 @@ private static List<GenSrcFile> generateClientFiles(OASClientConfig oasClientCon

List<ClientDiagnostic> clientDiagnostic = ballerinaClientGenerator.getDiagnostics();

if (!clientDiagnostic.isEmpty()) {
for (ClientDiagnostic diagnostic : clientDiagnostic) {
createDiagnostics(toolContext, diagnostic.getMessage(), diagnostic.getCode(),
diagnostic.getDiagnosticSeverity(), location);
}
for (ClientDiagnostic diagnostic : clientDiagnostic) {
createDiagnostics(toolContext, diagnostic.getMessage(), diagnostic.getCode(),
diagnostic.getDiagnosticSeverity(), location);
}

if (clientDiagnostic.stream().anyMatch(
diagnostic -> diagnostic.getDiagnosticSeverity() == DiagnosticSeverity.ERROR)) {
throw new ClientException("Error occurred while generating client");
}
if (clientDiagnostic.stream().anyMatch(
diagnostic -> diagnostic.getDiagnosticSeverity() == DiagnosticSeverity.ERROR)) {
throw new ClientException("Error occurred while generating client");
}

sourceFiles.add(new GenSrcFile(GenSrcFile.GenFileType.GEN_SRC, null, CLIENT_FILE_NAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,8 @@ public void generateClientAndService(String definitionPath, String serviceName,
//display diagnostics- client
List<ClientDiagnostic> clientDiagnostic = clientGenerator.getDiagnostics();

if (!clientDiagnostic.isEmpty()) {
for (ClientDiagnostic diagnostic : clientDiagnostic) {
outStream.println(diagnostic.getDiagnosticSeverity() + ":" + diagnostic.getMessage());
}
for (ClientDiagnostic diagnostic : clientDiagnostic) {
outStream.println(diagnostic.getDiagnosticSeverity() + ":" + diagnostic.getMessage());
}
printDiagnostic(diagnostics);
writeGeneratedSources(newGenFiles, srcPath, implPath, GEN_BOTH);
Expand Down Expand Up @@ -434,10 +432,8 @@ private List<GenSrcFile> generateClientFiles(Path openAPI, Filter filter, boolea
}

List<ClientDiagnostic> clientDiagnostic = clientGenerator.getDiagnostics();
if (!clientDiagnostic.isEmpty()) {
for (ClientDiagnostic diagnostic : clientDiagnostic) {
outStream.println(diagnostic.getDiagnosticSeverity() + ":" + diagnostic.getMessage());
}
for (ClientDiagnostic diagnostic : clientDiagnostic) {
outStream.println(diagnostic.getDiagnosticSeverity() + ":" + diagnostic.getMessage());
}
printDiagnostic(diagnosticList);
return sourceFiles;
Expand Down
2 changes: 1 addition & 1 deletion openapi-client-native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ tasks.withType(PublishToMavenRepository) {
onlyIf {
(repository == publishing.repositories.GitHub && publication == publishing.publications.GitHub) ||
(repository == publishing.repositories.WSO2Nexus && publication == publishing.publications.WSO2Nexus
&& (clientNativeVersion.endsWith('-SNAPSHOT') || !skipClientNativePublish))
&& (clientNativeVersion.endsWith('-SNAPSHOT') || clientNativePublish))
}
}

Expand Down

0 comments on commit b32c1ac

Please sign in to comment.