Skip to content

Commit

Permalink
Don't generate pom.xml
Browse files Browse the repository at this point in the history
because it's not possible to build with it (see
    criteo/criteo-api-java-sdk#13 ).
Not sure why, but it makes more sense to maintain gradle build script only.
  • Loading branch information
gturri committed Mar 26, 2024
1 parent 0b9c28c commit 5117f9a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 37 deletions.
2 changes: 1 addition & 1 deletion generator/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ task generateClient(type: GradleBuild) {

delete fileTree(clientOutputDirPerVersion) {
include '.openapi-generator-ignore', '.travis.yml', 'git_push.sh',\
'build.sbt', 'src/main/AndroidManifest.xml', 'gradle.properties'
'build.sbt', 'src/main/AndroidManifest.xml', 'gradle.properties', 'pom.xml'
}
followSymlinks = true
}
Expand Down
23 changes: 8 additions & 15 deletions generator/java/resources/templates/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,17 @@ More information: [https://developers.criteo.com/](https://developers.criteo.com
Building the API client library requires:

1. Java 1.8+
2. Maven/Gradle
2. Gradle

## Installation
## How to build

To install the API client library to your local Maven repository, simply execute:
To build the jar, simply execute:

```shell
mvn clean install
./gradlew jar
```

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

```shell
mvn clean deploy
```

Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
The built jar will be available in build/libs.

### Maven users

Expand Down Expand Up @@ -69,13 +63,12 @@ compile "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}"
At first generate the JAR by executing:

```shell
mvn clean package
./gradlew jar
```

Then manually install the following JARs:

* `target/{{{artifactId}}}-{{{artifactVersion}}}.jar`
* `target/lib/*.jar`
* `build/libs/{{{artifactId}}}-{{{artifactVersion}}}.jar`

## Example

Expand All @@ -101,4 +94,4 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea

## Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3 changes: 1 addition & 2 deletions generator/java/resources/templates/build.gradle.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ sourceSets {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

// Note: these dependencies should be kept in sync with the ones of the generated pom.xml
dependencies {
implementation 'io.swagger:swagger-annotations:1.6.8'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
Expand Down Expand Up @@ -132,4 +131,4 @@ nexusPublishing {
maxRetries.set(50)
delayBetween.set(java.time.Duration.ofMillis(3000))
}
}
}
19 changes: 0 additions & 19 deletions scripts/languages/java/java_sdk_test_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,6 @@ def __init__(self):

def execute(self, sdk_name):
self.logger.info(f'Starting testing SDK {sdk_name}...')

self.logger.info('Testing with the Maven setup !')
self.logger.info('Installing dependencies...')
run_command('mvn install', error_template=self.java_error_template)
self.logger.info('Install successful')

self.logger.info('Testing...')
run_command('mvn test', error_template=self.java_error_template, env={
'TEST_CLIENT_ID': assert_environment_variable('TEST_CLIENT_ID'),
'TEST_CLIENT_SECRET': assert_environment_variable('TEST_CLIENT_SECRET'),
'TEST_APPLICATION_ID': assert_environment_variable('TEST_APPLICATION_ID'),
})
self.logger.info('Test successful')

self.logger.info('Cleaning package...')
run_command('mvn clean')
self.logger.info('Clean successful')

self.logger.info('Testing with the Gradle setup !')
run_command('chmod u+x ./gradlew')
run_command('./gradlew check', error_template=self.java_error_template, env={
'TEST_CLIENT_ID': assert_environment_variable('TEST_CLIENT_ID'),
Expand Down

0 comments on commit 5117f9a

Please sign in to comment.