Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ The project is very much Work In Progress and will be published on maven central

# Release Notes
BOAT is still under development and subject to change.
## 0.15.6
* *Maven Plugin*
* Add example of use the additional properties like createApiComponent
* Boat Angular generator
* Generate an `ng-package.json` file for use with the `ng-package` CLI
## 0.15.5
* *Boat Lint*
* Bumped version of Zally Linting Libraries that contain several vulnerability fixes
Expand Down
2 changes: 1 addition & 1 deletion boat-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.backbase.oss</groupId>
<artifactId>backbase-openapi-tools</artifactId>
<version>0.15.5</version>
<version>0.15.6-SNAPSHOT</version>
</parent>
<artifactId>boat-engine</artifactId>
<packaging>jar</packaging>
Expand Down
9 changes: 9 additions & 0 deletions boat-maven-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ Same with `generate` but with opinionated defaults for Rest Template Client
</configOptions>
</configuration>

### Sample usage with additional feature

<configuration>
...
<additionalProperties>
<additionalProperty>createApiComponent=false</additionalProperty>
</additionalProperties>
</configuration>

## boat:generate-webclient-embedded

Same with `generate` but with opinionated defaults for Web Client
Expand Down
2 changes: 1 addition & 1 deletion boat-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.backbase.oss</groupId>
<artifactId>backbase-openapi-tools</artifactId>
<version>0.15.5</version>
<version>0.15.6-SNAPSHOT</version>
</parent>
<artifactId>boat-maven-plugin</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion boat-quay/boat-quay-lint/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.backbase.oss</groupId>
<artifactId>boat-quay</artifactId>
<version>0.15.5</version>
<version>0.15.6-SNAPSHOT</version>
</parent>

<artifactId>boat-quay-lint</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion boat-quay/boat-quay-rules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.backbase.oss</groupId>
<artifactId>boat-quay</artifactId>
<version>0.15.5</version>
<version>0.15.6-SNAPSHOT</version>
</parent>

<artifactId>boat-quay-rules</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion boat-quay/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.backbase.oss</groupId>
<artifactId>backbase-openapi-tools</artifactId>
<version>0.15.5</version>
<version>0.15.6-SNAPSHOT</version>
</parent>


Expand Down
4 changes: 2 additions & 2 deletions boat-scaffold/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.backbase.oss</groupId>
<artifactId>backbase-openapi-tools</artifactId>
<version>0.15.5</version>
<version>0.15.6-SNAPSHOT</version>
</parent>

<artifactId>boat-scaffold</artifactId>
Expand Down Expand Up @@ -87,7 +87,7 @@
<dependency>
<groupId>com.backbase.oss</groupId>
<artifactId>boat-trail-resources</artifactId>
<version>0.15.5</version>
<version>0.15.6-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ private void applyAngularVersion(String versionRange) {
private void addDependencies(SemVer angularVersion) {
if (additionalProperties.containsKey(NPM_NAME)) {
supportingFiles.add(new SupportingFile("package.mustache", getIndexDirectory(), "package.json"));
supportingFiles.add(new SupportingFile("ng-package.mustache", getIndexDirectory(), "ng-package.json"));
supportingFiles.add(new SupportingFile("tsconfig.mustache", getIndexDirectory(), "tsconfig.json"));
additionalProperties.put("zonejsVersion", "0.10.2");
additionalProperties.put("rxjsVersion", "6.6.0");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@
],
"license": "Unlicense",
"scripts": {
"build": "ng-packagr -p package.json"
},
"ngPackage": {
"lib": {
"entryFile": "public_api.ts"
},
"dest": "{{{buildDist}}}"
"build": "ng-packagr -p ng-package.json"
},
"peerDependencies": {
"@angular/core": "^{{ngVersion}}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator;
{{/withXml}}
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
{{#restTemplateBeanName}}
import org.springframework.beans.factory.annotation.Qualifier;
{{/restTemplateBeanName}}
Expand All @@ -31,7 +30,10 @@ import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter;
{{/withXml}}
{{#createApiComponent}}
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
{{/createApiComponent}}
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils;
Expand Down Expand Up @@ -88,7 +90,9 @@ import {{invokerPackage}}.auth.OAuth;
{{/authMethods}}

{{>generatedAnnotation}}
{{#createApiComponent}}
@Component("{{invokerPackage}}.ApiClient")
{{/createApiComponent}}
public class ApiClient {
public enum CollectionFormat {
CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null);
Expand Down Expand Up @@ -127,11 +131,15 @@ public class ApiClient {
}
{{/useDefaultApiClient}}
{{#useJacksonConversion}}
{{#createApiComponent}}
@Autowired
{{/createApiComponent}}
private ObjectMapper objectMapper;
{{/useJacksonConversion}}

{{#createApiComponent}}
@Autowired
{{/createApiComponent}}
public ApiClient({{#restTemplateBeanName}}@Qualifier("{{restTemplateBeanName}}") {{/restTemplateBeanName}}RestTemplate restTemplate) {
this.restTemplate = restTemplate;
init();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.backbase.oss.codegen.angular;

import java.util.Optional;
import java.util.stream.Collectors;
import lombok.SneakyThrows;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -90,6 +92,22 @@ void generate(Combination param) {
assertThat(this.files.size(), not(equalTo(0)));
}

@Check
public void ngPackageConfig() throws IOException {
var ngPackageFiles = selectFiles("/ng-package\\.json$");
if (this.param.npmName) {
assertThat(ngPackageFiles, hasSize(1));
List<String> content;
try (var lines = Files.lines(Paths.get(ngPackageFiles.get(0)))) {
content = lines.collect(Collectors.toList());
}
var dist = Optional.ofNullable(this.param.buildDist).orElse("dist");
assertThat(content, hasItem(containsString("\"dest\": \"" + dist + "\"")));
} else {
assertThat(ngPackageFiles, hasSize(0));
}
}

@Check
public void npmName() {
assertThat(
Expand Down
2 changes: 1 addition & 1 deletion boat-terminal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.backbase.oss</groupId>
<artifactId>backbase-openapi-tools</artifactId>
<version>0.15.5</version>
<version>0.15.6-SNAPSHOT</version>
</parent>

<artifactId>boat-terminal</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion boat-trail-resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.backbase.oss</groupId>
<artifactId>backbase-openapi-tools</artifactId>
<version>0.15.5</version>
<version>0.15.6-SNAPSHOT</version>
</parent>

<artifactId>boat-trail-resources</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.backbase.oss</groupId>
<artifactId>backbase-openapi-tools</artifactId>
<version>0.15.5</version>
<version>0.15.6-SNAPSHOT</version>

<packaging>pom</packaging>
<description>Backbase Open Api Tools will help you converting RAML to OpenAPI plus many more</description>
Expand Down Expand Up @@ -471,7 +471,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down Expand Up @@ -542,4 +542,4 @@
</build>
</profile>
</profiles>
</project>
</project>
2 changes: 1 addition & 1 deletion tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.backbase.oss</groupId>
<artifactId>backbase-openapi-tools</artifactId>
<version>0.15.5</version>
<version>0.15.6-SNAPSHOT</version>
</parent>

<artifactId>tests</artifactId>
Expand Down