Skip to content

Commit

Permalink
update build for gradle 6-8
Browse files Browse the repository at this point in the history
update CI build to temurin JDK 11
  • Loading branch information
pdowler committed Feb 26, 2025
1 parent 0b33589 commit 18f09e9
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 120 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
java-version: 11

- name: build and test cadc-jsqlparser-compat
run: cd cadc-jsqlparser-compat && ../gradlew --info clean build javadoc install
Expand All @@ -41,6 +41,6 @@ jobs:
- name: build and test cadc-test-tap
run: cd cadc-test-tap && ../gradlew --info clean build javadoc install

- name: build example-tap
run: cd example-tap && ../gradlew --info clean build
- name: build youcat
run: cd youcat && ../gradlew --info clean build

21 changes: 10 additions & 11 deletions cadc-adql/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id 'java'
id 'maven'
id "java-library"
id 'maven-publish'
id 'checkstyle'
}
Expand All @@ -12,7 +11,7 @@ repositories {

apply from: '../opencadc.gradle'

sourceCompatibility = 1.8
sourceCompatibility = 11

group = 'org.opencadc'

Expand All @@ -22,12 +21,12 @@ description = 'OpenCADC ADQL-2.0 parser library'
def git_url = 'https://github.com/opencadc/tap'

dependencies {
compile 'org.opencadc:cadc-util:[1.9,2.0)'
compile 'org.opencadc:cadc-gms:[1.0.4,)'
compile 'org.opencadc:cadc-tap:[1.1,)'
compile 'org.opencadc:cadc-tap-server:[1.1,)'
compile 'org.opencadc:cadc-tap-schema:[1.1.28,)'
compile 'org.opencadc:cadc-jsqlparser-compat:[0.6.4,)'

testCompile 'junit:junit:4.13'
implementation 'org.opencadc:cadc-util:[1.9,2.0)'
implementation 'org.opencadc:cadc-gms:[1.0.4,)'
implementation 'org.opencadc:cadc-tap:[1.1,)'
implementation 'org.opencadc:cadc-tap-server:[1.1,)'
implementation 'org.opencadc:cadc-tap-schema:[1.1.28,)'
implementation 'org.opencadc:cadc-jsqlparser-compat:[0.6.4,)'

testImplementation 'junit:junit:4.13'
}
10 changes: 6 additions & 4 deletions cadc-jsqlparser-compat/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
plugins {
id 'java'
id 'maven'
id "java-library"
id 'maven-publish'
id 'checkstyle'
}

repositories {
mavenCentral()
mavenLocal()
}

sourceCompatibility = 1.8
apply from: '../opencadc.gradle'

sourceCompatibility = 11

group = 'org.opencadc'

Expand All @@ -19,5 +21,5 @@ description = 'OpenCADC jsqlparser library (fork)'
def git_url = 'https://github.com/opencadc/tap'

dependencies {
testCompile 'junit:junit:4.13'
testImplementation 'junit:junit:4.13'
}
41 changes: 19 additions & 22 deletions cadc-tap-schema/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id "java"
id "maven"
id "java-library"
id 'maven-publish'
id 'checkstyle'
}
Expand All @@ -12,7 +11,7 @@ repositories {

apply from: '../opencadc.gradle'

sourceCompatibility = 1.8
sourceCompatibility = 11

group = 'org.opencadc'

Expand All @@ -22,23 +21,21 @@ description = 'OpenCADC TAP-1.1 tap schema server library'
def git_url = 'https://github.com/opencadc/tap'

dependencies {
compile 'org.jdom:jdom2:[2.0,)'
compile 'javax.servlet:javax.servlet-api:[3.1,4.0)'

compile 'org.opencadc:cadc-util:[1.8.4,2.0)'
compile 'org.opencadc:cadc-log:[1.1,2.0)'
compile 'org.opencadc:cadc-vosi:[1.3.2,2.0)'
compile 'org.opencadc:cadc-uws:[1.0,2.0)'
compile 'org.opencadc:cadc-uws-server:[1.2.4,2.0)'
compile 'org.opencadc:cadc-dali:[1.1,2.0)'
compile 'org.opencadc:cadc-cdp:[1.2.3,2.0)'
compile 'org.opencadc:cadc-gms:[1.0,2.0)'
compile 'org.opencadc:cadc-rest:[1.3.1,2.0)'
compile 'org.opencadc:cadc-tap:[1.1.17,2.0)'
compile 'uk.ac.starlink:jcdf:[1.2.3,2.0)'
compile 'uk.ac.starlink:stil:[4.0,5.0)'

testCompile 'junit:junit:[4.0,5.0)'
testCompile 'xerces:xercesImpl:[2.0,3.0)'
testRuntime 'org.postgresql:postgresql:[42.2.8,)'
implementation 'org.opencadc:cadc-util:[1.8.4,2.0)'
implementation 'org.opencadc:cadc-log:[1.1,2.0)'
implementation 'org.opencadc:cadc-vosi:[1.3.2,2.0)'
implementation 'org.opencadc:cadc-uws:[1.0,2.0)'
implementation 'org.opencadc:cadc-uws-server:[1.2.4,2.0)'
implementation 'org.opencadc:cadc-dali:[1.1,2.0)'
implementation 'org.opencadc:cadc-cdp:[1.2.3,2.0)'
implementation 'org.opencadc:cadc-gms:[1.0,2.0)'
implementation 'org.opencadc:cadc-rest:[1.3.1,2.0)'
implementation 'org.opencadc:cadc-tap:[1.1.17,2.0)'
implementation 'uk.ac.starlink:jcdf:[1.2.3,2.0)'
implementation 'uk.ac.starlink:stil:[4.0,5.0)'

testImplementation 'junit:junit:[4.0,5.0)'
testImplementation 'xerces:xercesImpl:[2.0,3.0)'

intTestRuntime 'org.postgresql:postgresql:[42.2.8,)'
}
8 changes: 5 additions & 3 deletions cadc-tap-server-oracle/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id 'java'
id 'maven'
id 'java-library'
id 'maven-publish'
id 'checkstyle'
}
Expand All @@ -11,8 +10,11 @@ repositories {
}

apply from: '../opencadc.gradle'
sourceCompatibility = 1.8

sourceCompatibility = 11

group = 'org.opencadc'

version = '1.2.11'

description = 'OpenCADC TAP-1.1 tap server plugin (Oracle)'
Expand Down
19 changes: 8 additions & 11 deletions cadc-tap-server-pg/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id "java"
id "maven"
id "java-library"
id 'maven-publish'
id 'checkstyle'
}
Expand All @@ -12,7 +11,7 @@ repositories {

apply from: '../opencadc.gradle'

sourceCompatibility = 1.8
sourceCompatibility = 11

group = 'org.opencadc'

Expand All @@ -22,12 +21,10 @@ description = 'OpenCADC TAP-1.1 tap server plugin (PostgreSQL+pgsphere)'
def git_url = 'https://github.com/opencadc/tap'

dependencies {
compile 'org.opencadc:cadc-dali-pg:[0.1,)'
compile 'org.opencadc:cadc-adql:[1.1.14,)'
compile 'org.opencadc:cadc-tap-schema:[1.2.1, )'
compile 'org.opencadc:cadc-tap-server:[1.1.7, )'

testCompile 'junit:junit:[4.0,5.0)'
testCompile 'org.opencadc:cadc-util:[1.2,)'
testCompile 'xerces:xercesImpl:[2.0,)'
implementation 'org.opencadc:cadc-dali-pg:[0.1,)'
implementation 'org.opencadc:cadc-adql:[1.1.14,)'
implementation 'org.opencadc:cadc-tap-schema:[1.2.1, )'
implementation 'org.opencadc:cadc-tap-server:[1.1.7, )'

testImplementation 'junit:junit:[4.0,5.0)'
}
10 changes: 5 additions & 5 deletions cadc-tap-server/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
plugins {
id "java"
id "maven"
id "java-library"
id 'maven-publish'
id 'checkstyle'
}

repositories {
mavenCentral()
mavenLocal()
}

sourceCompatibility = 1.8
apply from: '../opencadc.gradle'

sourceCompatibility = 11

group = 'org.opencadc'

Expand All @@ -19,8 +21,6 @@ description = 'OpenCADC TAP-1.1 tap server library'
def git_url = 'https://github.com/opencadc/tap'

dependencies {
implementation 'org.jdom:jdom2:[2.0,)'

implementation 'org.opencadc:cadc-util:[1.6,)'
implementation 'org.opencadc:cadc-tap:[1.1.0,1.2)'
implementation 'org.opencadc:cadc-tap-schema:[1.1.28,)'
Expand Down
3 changes: 1 addition & 2 deletions cadc-tap-tmp/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id "java"
id "maven"
id "java-library"
id 'maven-publish'
id 'checkstyle'
}
Expand Down
19 changes: 9 additions & 10 deletions cadc-tap/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id "java"
id "maven"
id "java-library"
id 'maven-publish'
id 'checkstyle'
}
Expand All @@ -12,7 +11,7 @@ repositories {

apply from: '../opencadc.gradle'

sourceCompatibility = 1.8
sourceCompatibility = 11

group = 'org.opencadc'
version = '1.1.17'
Expand All @@ -21,13 +20,13 @@ description = 'OpenCADC TAP-1.1 tap client library'
def git_url = 'https://github.com/opencadc/tap'

dependencies {
compile 'org.apache.commons:commons-csv:[1.6,1.7)'
implementation 'org.apache.commons:commons-csv:[1.6,1.7)'

compile 'org.opencadc:cadc-util:[1.6.3,2.0)'
compile 'org.opencadc:cadc-registry:[1.7.2,2.0)'
compile 'org.opencadc:cadc-dali:[1.2,2.0)'
compile 'org.opencadc:cadc-vosi:[1.0,2.0)'
compile 'org.opencadc:cadc-gms:[1.0,)'
implementation 'org.opencadc:cadc-util:[1.6.3,2.0)'
implementation 'org.opencadc:cadc-registry:[1.7.2,2.0)'
implementation 'org.opencadc:cadc-dali:[1.2,2.0)'
implementation 'org.opencadc:cadc-vosi:[1.0,2.0)'
implementation 'org.opencadc:cadc-gms:[1.0,)'

testCompile 'junit:junit:[4.1,5.0)'
testImplementation 'junit:junit:[4.1,5.0)'
}
48 changes: 30 additions & 18 deletions opencadc.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
configurations {
checkstyleDep
intTestCompile.extendsFrom testCompile
intTestRuntime.extendsFrom testRuntime
intTestImplementation.extendsFrom testImplementation
}

dependencies {
testCompile 'com.puppycrawl.tools:checkstyle:8.2'
testImplementation 'com.puppycrawl.tools:checkstyle:8.2'
checkstyleDep 'org.opencadc:cadc-quality:[1.0,)'
}

Expand All @@ -17,32 +16,29 @@ checkstyle {
}

sourceSets {
test {
resources.srcDirs += 'src/test/resources'
}
intTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
runtimeClasspath += compileClasspath
}
resources.srcDir file('src/intTest/resources')
resources.srcDirs += file('src/intTest/resources')
resources.srcDirs += new File(System.getenv('A') + '/test-certificates/')
}
}

// Temporary work around for issue https://github.com/gradle/gradle/issues/881 -
// gradle not displaying fail build status when warnings reported -->

tasks.withType(Checkstyle).each { checkstyleTask ->
checkstyleTask.doLast {
reports.all { report ->
def outputFile = report.destination
if (outputFile.exists() && outputFile.text.contains("<error ")) {
throw new GradleException("There were checkstyle warnings! For more info check $outputFile")
}
}
}
}
//tasks.withType(Checkstyle).each { checkstyleTask ->
// checkstyleTask.doLast {
// reports.all { report ->
// def outputFile = report.destination
// if (outputFile.exists() && outputFile.text.contains("<error ")) {
// throw new GradleException("There were checkstyle warnings! For more info check $outputFile")
// }
// }
// }
//}

tasks.withType(Test) {
// reset the report destinations so that intTests go to their own page
Expand Down Expand Up @@ -76,3 +72,19 @@ intTest {
// "STARTED",
}
}

pluginManager.withPlugin('maven-publish') {
// configure maven-publish to support publishToMavenLocal
publishing {
publications {
thisLibrary(MavenPublication) {
from components.java
}
}
}
}

// backwards compat usage
task install {
dependsOn 'publishToMavenLocal'
}
Loading

0 comments on commit 18f09e9

Please sign in to comment.