Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to hale 5 #3

Merged
merged 3 commits into from
Sep 14, 2023
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
56 changes: 56 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Check

on:
pull_request:
branches:
- master

jobs:
gradle:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build and test with Gradle
run: ./gradlew clean check
# https://github.com/marketplace/actions/junit-report-action
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: 'build/test-results/*/*.xml'
check_name: 'JUnit test report (gradle)'
require_passed_tests: true


maven:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup Maven
uses: s4u/[email protected]
with:
java-version: 17
java-distribution: temurin
maven-version: 3.9.0
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Generate sources with Gradle
run: ./gradlew regenerateSources
- name: Build and test with Maven
run: mvn clean verify # -Dmaven.test.failure.ignore=true
# https://github.com/marketplace/actions/junit-report-action
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: 'target/surefire-reports/*.xml'
check_name: 'JUnit test report (maven)'
require_passed_tests: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ buildNumber.properties
/.classpath
/.project

/.idea/

/src/main/java/**/*.java
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
# hale-codegen-example
Example project using hale-codegen

## Gradle

Generate sources and run tests with

```
./gradlew check
```

## Maven

To generate sources Gradle must be used:

```
./gradlew regenerateSources
```

Then source can be built and tests run with Maven:

```
mvn verify
```
52 changes: 21 additions & 31 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,20 @@ import to.wetransform.hale.codegen.generator.CLI
buildscript {
repositories {
maven {
url 'http://download.osgeo.org/webdav/geotools/'
url 'https://repo.osgeo.org/repository/release/'
}

jcenter()
mavenCentral()

// HALE artifacts
maven {
url 'https://artifactory.wetransform.to/artifactory/libs-release'
url 'https://artifactory.wetransform.to/artifactory/local'
}
// HALE artifactory
maven {
url 'http://artifactory.esdi-humboldt.eu/artifactory/libs-release/'
}

mavenLocal()
}

dependencies {
classpath 'org.standardout:gradle-eclipseconfig:1.0.0'
classpath 'to.wetransform.hale-codegen:generator:1.0.0-SNAPSHOT'
classpath 'to.wetransform.hale-codegen:generator:0.3.0-SNAPSHOT'
}
}

Expand All @@ -33,21 +27,15 @@ sourceCompatibility = '1.8'

repositories {
maven {
url 'http://download.osgeo.org/webdav/geotools/'
url 'https://repo.osgeo.org/repository/release/'
}

jcenter()
mavenCentral()

// HALE artifacts
maven {
url 'https://artifactory.wetransform.to/artifactory/libs-release'
url 'https://artifactory.wetransform.to/artifactory/local'
}
// HALE artifactory
maven {
url 'http://artifactory.esdi-humboldt.eu/artifactory/libs-release/'
}

mavenLocal()
}

configurations.all {
Expand All @@ -56,22 +44,23 @@ configurations.all {
}

project.ext {
haleVersion = '3.0.0'
haleVersion = '5.0.1'
}

dependencies {
compile 'to.wetransform.hale-codegen:model:1.0.0-SNAPSHOT'
implementation 'eu.esdihumboldt.unpuzzled:org.eclipse.equinox.nonosgi.registry:1.0.0'
implementation 'to.wetransform.hale-codegen:model:0.3.0-SNAPSHOT'
// for GeometryProperty
compile "eu.esdihumboldt.hale:eu.esdihumboldt.hale.common.schema:$haleVersion"
implementation "eu.esdihumboldt.hale:eu.esdihumboldt.hale.common.schema:$haleVersion"

testCompile 'junit:junit:4.12'
testCompile 'to.wetransform.hale-codegen:instances:1.0.0-SNAPSHOT'
testCompile "eu.esdihumboldt.hale:eu.esdihumboldt.hale.io.xsd:$haleVersion"
testCompile "eu.esdihumboldt.hale:eu.esdihumboldt.hale.io.xml:$haleVersion"
testCompile "eu.esdihumboldt.hale:eu.esdihumboldt.hale.io.gml:$haleVersion"
testImplementation 'junit:junit:4.12'
testImplementation 'to.wetransform.hale-codegen:instances:0.3.0-SNAPSHOT'
testImplementation "eu.esdihumboldt.hale:eu.esdihumboldt.hale.io.xsd:$haleVersion"
testImplementation "eu.esdihumboldt.hale:eu.esdihumboldt.hale.io.xml:$haleVersion"
testImplementation "eu.esdihumboldt.hale:eu.esdihumboldt.hale.io.gml:$haleVersion"
}

task regenerateSources << {
task('regenerateSources').doFirst {
File targetDir = project.file('src/main/java')
targetDir.deleteDir();
targetDir.mkdirs();
Expand All @@ -81,9 +70,10 @@ task regenerateSources << {
CLI.run(schemaLocation, targetDir)
}

tasks.classes.dependsOn('regenerateSources')
tasks.compileJava.dependsOn('regenerateSources')

task wrapper(type: Wrapper) {
gradleVersion = '3.0'
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
gradleVersion = '8.3'
}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Wed Sep 21 10:26:50 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip
Loading