Skip to content
Open
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
37 changes: 0 additions & 37 deletions .github/workflows/android-ci.yml

This file was deleted.

146 changes: 133 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: CI

on:
Expand All @@ -11,23 +10,144 @@ on:
workflow_dispatch:

jobs:
test:
project-test:
runs-on: ubuntu-latest
continue-on-error: true # allow jobs to complete even if some fail
strategy:
matrix:
java_version: [8]
java: [8, 11, 17, 21, 25]
max-parallel: 4
name: Test JDK ${{ matrix.java_version }}
name: JDK ${{ matrix.java }} | Project
steps:
- name: Setup Maven Action
uses: s4u/[email protected]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these actions changing because we are introducing mvnw? I think we should do something to isolate the introduction of mvnw. It would help the review and approval process for a change this big and impactful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More or less. Right now, setup-maven-action doesn’t really add value: it just avoids having to declare actions/checkout manually.

- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
checkout-fetch-depth: 0
java-version: ${{ matrix.java_version }}
java-distribution: temurin
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: maven

- name: Verify with Maven
run: ./mvnw verify -B
- name: Verify jsonschema2pojo-gradle-plugin integration tests
run: |
./mvnw -U -B install -DskipTests -Dmaven.javadoc.skip -Dmaven.site.skip -pl jsonschema2pojo-gradle-plugin -am
./mvnw -U -B install -pl jsonschema2pojo-gradle-plugin

- name: Prepare for next jobs - Install current SNAPSHOT
run: ./mvnw -U -B install -DskipTests -Dmaven.javadoc.skip -Dmaven.site.skip

- name: Prepare for next jobs - Upload org.jsonschema2pojo artifacts (per JDK)
uses: actions/upload-artifact@v4
with:
name: m2-jsonschema2pojo-jdk${{ matrix.java }}
path: ~/.m2/repository/org/jsonschema2pojo
if-no-files-found: error

gradle-example-android:
needs: project-test
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
build-java: [8, 11, 17, 21, 25]
run:
- { java: 8, gradle: '7.6.4' } # AGP Java 8 => Gradle 7.6.4 (MavenPlugin legacy)
- { java: 11, gradle: '7.6.4' }
- { java: 17, gradle: '8.9' }
- { java: 21, gradle: '8.9' }
- { java: 25, gradle: '9.1.0' }
name: JDK ${{ matrix.build-java }} | Example Gradle (Android) | run on Java ${{ matrix.run.java }}
steps:
- uses: actions/checkout@v3

- name: Install Android SDK
uses: malinskiy/action-android/install-sdk@release/0.1.1

- name: Download m2 org.jsonschema2pojo (matching build-java)
uses: actions/download-artifact@v4
with:
name: m2-jsonschema2pojo-jdk${{ matrix.build-java }}
path: ~/.m2/repository/org/jsonschema2pojo

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.run.java }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: ${{ matrix.run.gradle }}

- name: Build Gradle example (Android)
working-directory: jsonschema2pojo-gradle-plugin/example/android
run: gradle --warning-mode all --info assembleDebug

gradle-example-java:
needs: project-test
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
build-java: [8, 11, 17, 21, 25]
run:
- { java: 8, gradle: '8.9' }
- { java: 11, gradle: '8.9' }
- { java: 17, gradle: '8.9' }
- { java: 21, gradle: '8.9' }
- { java: 25, gradle: '9.1.0' }
name: JDK ${{ matrix.build-java }} | Example Gradle (Java) | run on Java ${{ matrix.run.java }}
steps:
- uses: actions/checkout@v3

- name: Download m2 org.jsonschema2pojo (matching build-java)
uses: actions/download-artifact@v4
with:
name: m2-jsonschema2pojo-jdk${{ matrix.build-java }}
path: ~/.m2/repository/org/jsonschema2pojo

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.run.java }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: ${{ matrix.run.gradle }}

- name: Build Gradle example (Java)
working-directory: jsonschema2pojo-gradle-plugin/example/java
run: gradle --warning-mode all --info build

maven-example:
needs: project-test
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
build-java: [8, 11, 17, 21, 25]
run-java: [8, 11, 17, 21, 25]
name: JDK ${{ matrix.build-java }} | Example Maven | run on Java ${{ matrix.run-java }}
steps:
- uses: actions/checkout@v3

- name: Download m2 org.jsonschema2pojo (matching build-java)
uses: actions/download-artifact@v4
with:
name: m2-jsonschema2pojo-jdk${{ matrix.build-java }}
path: ~/.m2/repository/org/jsonschema2pojo

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.run-java }}

- name: Setup Maven
uses: s4u/[email protected]
with:
maven-version: 3.9.9

- name: Build Maven example
working-directory: jsonschema2pojo-maven-plugin/example
run: mvn package
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
apply plugin: 'jsonschema2pojo'

android {
namespace "jsonschema2pojo.joelittlejohn.github.com.androidexample"
compileSdkVersion 30

defaultConfig {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jsonschema2pojo.joelittlejohn.github.com.androidexample" >
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand Down
6 changes: 5 additions & 1 deletion jsonschema2pojo-gradle-plugin/example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
classpath 'com.android.tools.build:gradle:8.5.2'
} else {
classpath 'com.android.tools.build:gradle:4.2.2'
}
classpath 'org.jsonschema2pojo:jsonschema2pojo-gradle-plugin:latest.integration'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apply plugin: 'jsonschema2pojo'


android {
namespace "jsonschema2pojo.joelittlejohn.github.com.androidexample"
compileSdkVersion 30

defaultConfig {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest package="jsonschema2pojo.joelittlejohn.github.com.androidlibexample">
<manifest>

<application/>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apply plugin: 'jsonschema2pojo'


android {
namespace "jsonschema2pojo.joelittlejohn.github.com.androidexample"
compileSdkVersion 30

defaultConfig {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest package="jsonschema2pojo.joelittlejohn.github.com.androidlibexample">
<manifest>

<application/>
</manifest>
3 changes: 2 additions & 1 deletion jsonschema2pojo-gradle-plugin/example/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'jsonschema2pojo'
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
}

dependencies {
Expand All @@ -16,6 +16,7 @@ buildscript {
}

repositories {
mavenLocal()
mavenCentral()
}

Expand Down
38 changes: 6 additions & 32 deletions jsonschema2pojo-gradle-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
<artifactId>gradle-api</artifactId>
<version>${gradle.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
Expand All @@ -43,10 +49,6 @@
</dependency>
</dependencies>

<properties>
<integrationTestSourceDirectory>src/integrationTest/groovy</integrationTestSourceDirectory>
</properties>

<build>
<sourceDirectory>${project.basedir}/src/main/groovy</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/groovy</testSourceDirectory>
Expand Down Expand Up @@ -79,18 +81,6 @@
</sources>
</configuration>
</execution>
<execution>
<id>add-integration-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>${integrationTestSourceDirectory}</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down Expand Up @@ -133,22 +123,6 @@
</includes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<useFile>false</useFile>
<testSourceDirectory>${integrationTestSourceDirectory}</testSourceDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>codenarc-maven-plugin</artifactId>
Expand Down

This file was deleted.

Loading
Loading