Skip to content

Commit

Permalink
OD-17115 Upgrade Gradle to version 8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
KeyrisXdSnow committed Jul 10, 2024
1 parent ae61e9d commit 714a844
Show file tree
Hide file tree
Showing 14 changed files with 228 additions and 144 deletions.
23 changes: 18 additions & 5 deletions api-doc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/*
* Copyright ish group pty ltd 2020.
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU Affero General Public License version 3 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
*/

apply from: "$rootDir/nodeSetup.gradle"

task apiDoc(type: NpmTask, dependsOn: [':server-api:apiDocs_mergeSwagger', 'npmInstall']) {
Expand All @@ -9,22 +20,24 @@ task apiDoc(type: NpmTask, dependsOn: [':server-api:apiDocs_mergeSwagger', 'npmI
npmCommand = ['run']
args = ['build']

outputs.dir("${buildDir}/api-docs")
outputs.dir("${layout.buildDirectory.get()}/api-docs")
}

build.dependsOn(apiDoc)

task packageApiDoc (type: Zip, dependsOn: apiDoc) {
group = "documentation"
from apiDoc.outputs.files
archiveClassifier = 'documentation'
}

tasks.named('build') {
dependsOn apiDoc
}

publishing {
publications {
docs(MavenPublication) {
create("docs", MavenPublication) {
artifact(packageApiDoc) {
artifactId "apiDoc"
artifactId = "apiDoc"
}
}
}
Expand Down
20 changes: 14 additions & 6 deletions api-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import test.PrepareTestDatabase

/*
* Copyright ish group pty ltd 2020.
*
Expand All @@ -11,6 +9,17 @@ import test.PrepareTestDatabase
* See the GNU Affero General Public License for more details.
*/

import test.PrepareTestDatabase

plugins {
id 'java'
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

ext {
karateVersion = '1.0.1'
}
Expand All @@ -29,9 +38,6 @@ dependencies {
testImplementation "org.eclipse.jetty:jetty-client:$jettyVersion"
}

sourceCompatibility = 11
targetCompatibility = 11

task copyConfig(type: Copy) {
from("$rootDir/api-test/src/test/resources/") {
include 'onCourse.yml'
Expand All @@ -52,7 +58,9 @@ test {
events "failed", "standardOut"
}

tasks.getByName('prepareTestDatabase').mustRunAfter(':server:startDaemon').mustRunAfter('copyConfig')
tasks.named('prepareTestDatabase').get()
.mustRunAfter(':server:startDaemon')
.mustRunAfter('copyConfig')

dependsOn "copyConfig"
dependsOn ":server:startDaemon"
Expand Down
35 changes: 16 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*/

buildscript {
ext {
log4j2Version = '2.17.2'
Expand All @@ -31,11 +32,11 @@ buildscript {
}

plugins {
id 'com.github.ben-manes.versions' version '0.39.0' // adds the task 'dependencyUpdates -Drevision=release'
id 'com.github.node-gradle.node' version '3.1.1' apply false
id 'com.github.psxpaul.execfork' version '0.1.15' apply false
id 'com.github.ben-manes.versions' version '0.51.0' // adds the task 'dependencyUpdates -Drevision=release'
id 'com.github.node-gradle.node' version '7.0.1' apply false
id 'com.github.psxpaul.execfork' version '0.2.2' apply false
id 'idea'
id 'org.barfuin.gradle.taskinfo' version '1.2.0' // adds the task 'tiTree [some task]' and the task 'tiOrder [some task]'
id 'org.barfuin.gradle.taskinfo' version '2.2.0' // adds the task 'tiTree [some task]' and the task 'tiOrder [some task]'

id 'java'
id 'groovy'
Expand Down Expand Up @@ -64,7 +65,11 @@ subprojects {
// added it exactly here since api dep doesn't work without that plugin
apply plugin: 'java-library'

sourceCompatibility = 11
java {
sourceCompatibility = JavaVersion.VERSION_11
}

group = 'ish.oncourse.angel'
// get the version from the command line properties
version = project.hasProperty('releaseVersion') && project.releaseVersion ? project.releaseVersion : "99-SNAPSHOT"
version = version.replace('v','') // remove the leading v from the version
Expand All @@ -90,22 +95,15 @@ subprojects {

implementation 'javax.annotation:javax.annotation-api:1.3.2'



testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.0'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.0'
testImplementation 'org.junit.vintage:junit-vintage-engine:5.8.0' // needed for dbunit https://sourceforge.net/p/dbunit/feature-requests/222/
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testImplementation 'org.dbunit:dbunit:2.7.0'

testImplementation "org.codehaus.groovy:groovy-test-junit5:$groovyVersion"
testImplementation "org.codehaus.groovy:groovy-sql:$groovyVersion"
}
// uncomment when dbunit is detached from junit
// configurations {
// testImplementation.exclude group: 'junit' // exclude junit4
// }

group = 'ish.oncourse.angel'

publishing {
repositories {
Expand Down Expand Up @@ -141,8 +139,7 @@ subprojects {
test {
useJUnitPlatform()

systemProperties 'java.awt.headless': 'true',
'java.locale.providers': 'COMPAT,SPI'
systemProperties 'java.awt.headless': 'true', 'java.locale.providers': 'COMPAT,SPI'
maxHeapSize = '3000M'
maxParallelForks = 1
ignoreFailures = true
Expand All @@ -153,7 +150,7 @@ subprojects {
}

reports {
junitXml.enabled = true
junitXml.required = true
}

afterSuite { desc, result ->
Expand All @@ -162,17 +159,17 @@ subprojects {
}
}
doLast {
if (testFailed) {
if (ext.testFailed) {
throw new Exception("tests failed, exit code == 1")
}
}
}
}

task testReport(type: TestReport) {
destinationDir = file("$buildDir/reports/tests")
destinationDirectory = file("${layout.buildDirectory.get()}/reports/tests")
// Include the results from the `test` task in all subprojects
reportOn subprojects*.test
testResults.from = subprojects*.test
}

// Skip beta and other non-final releases in the update report
Expand Down
7 changes: 5 additions & 2 deletions buildSrc/aql/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@
*/

plugins {
id 'java'
id 'java-gradle-plugin'
id 'groovy'
id 'antlr'
}

java {
sourceCompatibility = JavaVersion.VERSION_11
}

repositories {
mavenCentral()
}
Expand All @@ -26,5 +31,3 @@ ext {
dependencies {
antlr "org.antlr:antlr4:$antlrVersion"
}

sourceCompatibility = JavaVersion.VERSION_11
10 changes: 8 additions & 2 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
* See the GNU Affero General Public License for more details.
*/

plugins {
id 'java'
}

java {
sourceCompatibility = JavaVersion.VERSION_11
}

repositories {
mavenCentral()
}
Expand All @@ -18,5 +26,3 @@ subprojects {
runtimeOnly project(path)
}
}

sourceCompatibility = JavaVersion.VERSION_11
7 changes: 5 additions & 2 deletions buildSrc/swagger/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@
*/

plugins {
id 'java'
id 'java-gradle-plugin'
id 'groovy'
}

java {
sourceCompatibility = JavaVersion.VERSION_11
}

repositories {
mavenCentral()
}

dependencies {
implementation 'io.swagger:swagger-codegen:2.4.0'
}

sourceCompatibility = JavaVersion.VERSION_11
21 changes: 17 additions & 4 deletions buildSrc/testDataset/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
/*
* Copyright ish group pty ltd 2020.
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU Affero General Public License version 3 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
*/

plugins {
id 'java-gradle-plugin'
id 'groovy'
id 'java'
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

repositories {
mavenCentral()
}
Expand All @@ -12,7 +28,4 @@ dependencies {
implementation 'org.dbunit:dbunit:2.6.0'
implementation "org.mariadb.jdbc:mariadb-java-client:2.7.4"
implementation 'commons-io:commons-io:2.11.0'
}

sourceCompatibility = 11
targetCompatibility = 11
}
28 changes: 17 additions & 11 deletions client-html/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ plugins {

apply from: "$rootDir/nodeSetup.gradle"

sourceSets {
main.resources.srcDirs 'src/js', 'build/generated-sources/swagger-js', 'build/generated-sources/aql-model', 'build/generated-sources/aql-parser'
}

task webpack(type: NpmTask, dependsOn: 'queryGrammar') {
inputs.files("webpack.config.js", "tsconfig.json", "package-lock.json", "package.json", "jest.config.js")
inputs.dir("src")
outputs.dir("$buildDir/assets")
outputs.dir("${layout.buildDirectory.get()}/assets")
inputs.property('version', version)
npmCommand = ['run']
args = ['build:prod', "BUILD_NUMBER=${version ?: '99-SNAPSHOT'}"]
Expand All @@ -35,7 +38,7 @@ task npm_outdated(type: NpmTask) {

task queryGrammar(type: NpmTask, dependsOn: [':server-api:swagger', 'npmInstall', 'generateQueryLanguageModel']) {
inputs.dir("$rootDir/buildSrc/aql/src/main/resources/")
outputs.dir("$buildDir/generated-sources/aql-parser")
outputs.dir("${layout.buildDirectory.get()}/generated-sources/aql-parser")
npmCommand = ['run']
args = ['antlr4ts']
}
Expand All @@ -44,20 +47,23 @@ task jest(type: NpmTask, dependsOn: 'queryGrammar') {
npmCommand = ['run']
args = ['test']
}
test.dependsOn(jest)

sourceSets {
main.resources.srcDirs 'src/js', 'build/generated-sources/swagger-js', 'build/generated-sources/aql-model', 'build/generated-sources/aql-parser'
}

build.dependsOn(webpack)

generateQueryLanguageModel {
source = fileTree("$rootDir/types/src/main/groovy")
.plus(fileTree("$rootDir/types/src/main/java"))
.plus(fileTree("$rootDir/server/src/main/java"))

destinationDir = file("$buildDir/generated-sources/aql-model")
destinationDir = file("${layout.buildDirectory.get()}/generated-sources/aql-model")
}

tasks.named('test') {
dependsOn jest
}

processResources.dependsOn(':server-api:swagger', "generateQueryLanguageModel")
tasks.named('build') {
dependsOn webpack
}

tasks.named('processResources') {
dependsOn(':server-api:swagger', "generateQueryLanguageModel", "queryGrammar")
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
13 changes: 12 additions & 1 deletion nodeSetup.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
/*
* Copyright ish group pty ltd 2020.
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU Affero General Public License version 3 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
*/

apply plugin: 'com.github.node-gradle.node'

node {
version = '16.14.2'
download = System.properties['os.name'] != "FreeBSD" // FreeBSD has no binaries this plugin can install
workDir = file("${project.buildDir}/nodejs")
workDir = file("${project.layout.buildDirectory.get()}/nodejs")
npmInstallCommand = System.getenv("CI") ? 'ci' : 'install'
}

Expand Down
Loading

0 comments on commit 714a844

Please sign in to comment.