Skip to content

Fix Most Gradle Deprecation Warnings & Update Wrapper #331

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

Merged
merged 11 commits into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ The following are a few guidelines on how we suggest you start.
- EditorConfig by JetBrains (might be already activated)
- Spek Framework by Spek Team
3. Import the project (import the build.gradle -> import as project, works more reliably)
4. Open up a terminal (e.g. Intellij's built in -> usually ALT+F12) and run `./gr build`
This builds the project (compile, run tests etc) via gradle (notice, we renamed `gradlew` to `gr`, more convenient no?)
4. Open up a terminal (e.g. Intellij's built in -> usually ALT+F12) and run `./gradlew build`
This builds the project (compile, run tests etc) via gradle
5. Read up the [Coding Conventions of Atrium](#coding-conventions) (there are only 5 points).

Note: IntelliJ requires a few workarounds.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
java-version: ${{ matrix.java_version }}
- name: Build buildNonDeprecatedJvm
run: ./gr buildNonDeprecatedJvm
run: ./gradlew buildNonDeprecatedJvm

- name: build sample atrium+spek project
run: samples\jvm\spek\gradlew -p samples\jvm\spek build
Expand Down
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,28 @@ language: java
jdk:
- openjdk11

before_install: chmod +x gr

install: skip

jobs:
include:
- env: MODE=current_11
script: ./gr buildAllWithoutJs
script: ./gradlew buildAllWithoutJs
after_success: bash <(curl -s https://codecov.io/bash) -F current

- env: MODE=current_8
jdk: oraclejdk8
script: ./gr buildNonDeprecatedJvm buildAllAndroid
script: ./gradlew buildNonDeprecatedJvm buildAllAndroid
after_success: bash <(curl -s https://codecov.io/bash) -F current

- env: MODE=js
script: ./gr buildAllJs
script: ./gradlew buildAllJs

- env: MODE=bbc
script: ./gr bbcTests
script: ./gradlew bbcTests
after_success: bash <(curl -s https://codecov.io/bash) -F bbc

- env: MODE=bc
script: ./gr bcTests
script: ./gradlew bcTests
after_success: bash <(curl -s https://codecov.io/bash) -F bc

- env: MODE=samples
Expand Down
19 changes: 7 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ buildscript {

// project setup
tutteli_plugins_version = '0.32.2'
node_plugin_version = '1.3.1'
node_plugin_version = '2.2.0'

// gh-pages.gradle
docProjects = subprojects.findAll {
Expand Down Expand Up @@ -113,7 +113,7 @@ buildscript {
classpath "ch.tutteli:tutteli-gradle-project-utils:$tutteli_plugins_version"
classpath "ch.tutteli:tutteli-gradle-publish:$tutteli_plugins_version"
classpath "ch.tutteli:tutteli-gradle-spek:$tutteli_plugins_version"
classpath "com.moowork.gradle:gradle-node-plugin:$node_plugin_version"
classpath "com.github.node-gradle:gradle-node-plugin:$node_plugin_version"
}
}

Expand Down Expand Up @@ -412,7 +412,7 @@ List<Project> projectNamesToProject(String[] names) {

def createJsTestTask(String... subprojectNames) {
configure(projectNamesToProject(subprojectNames)) {
apply plugin: 'com.moowork.node'
apply plugin: 'com.github.node-gradle.node'

compileTestKotlin2Js.configure {
kotlinOptions.moduleKind = "commonjs"
Expand Down Expand Up @@ -441,13 +441,8 @@ def createJsTestTask(String... subprojectNames) {
nodeModulesDir = nodeModulesParentDir
}

task installMocha(type: NpmTask) {
args = ['install', 'mocha', '--prefer-offline']
}

task prepareMocha(dependsOn: [compileTestKotlin2Js, populateNodeModules, installMocha])
task runMocha(type: NodeTask, dependsOn: [prepareMocha, test]) {
script = file("$nodeModulesParentDir/node_modules/mocha/bin/mocha")
task runMocha(type: NpxTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, test]) {
command = "mocha"
args = [compileTestKotlin2Js.outputFile]
}
check.dependsOn runMocha
Expand All @@ -467,7 +462,7 @@ createJsTestTask(
def useJupiter(String... projectNames) {
configure(projectNamesToProject(projectNames)) {
dependencies {
testRuntime "org.junit.jupiter:junit-jupiter-engine:$jupiter_version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$jupiter_version"
}
test {
options {
Expand Down Expand Up @@ -537,7 +532,7 @@ Release & deploy a commit
d) commit & push changes
4. deploy to bintray:
// CI=true is a temporary work around till https://youtrack.jetbrains.com/issue/KT-29069 is fixed:
a) java -version 2>&1 | grep "version \"9" && CI=true ./gr clean publishToBintray
a) java -version 2>&1 | grep "version \"9" && CI=true ./gradlew clean publishToBintray
b) Log in to bintray, check that there are 926 artifacts and publish them
c) synchronise to maven central
5. create release on github
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = 'Contains the bits and pieces behind robstoll\'s <rstoll@tutteli.c
'Atrium, then you should depend on atrium-core-robstoll instead.'

dependencies {
compile prefixedProject('core-api-android')
implementation prefixedProject('core-api-android')

// it is up to the consumer of atrium-core-robstoll-lib which atrium-translations module is used at runtime
compileOnly prefixedProject('translations-en_GB-android')
Expand Down
6 changes: 3 additions & 3 deletions gradle/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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-5.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 12 additions & 17 deletions gr → gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -175,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
File renamed without changes.
2 changes: 1 addition & 1 deletion misc/tools/atrium-bc-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def createBcAndBbcTasks(String apiName, String oldVersion, String forgive) {
}
add(confCommon, sourceSets.main.runtimeClasspath)

owner."${srcName}Compile" configurations[confCommon].dependencies
owner."${srcName}Implementation" configurations[confCommon].dependencies
}

def getArgs = { String scanClassPath ->
Expand Down
4 changes: 2 additions & 2 deletions misc/verbs/atrium-verbs-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ dependencies {
api prefixedProject('core-api-android')

testImplementation prefixedProject('specs-android')
testRuntime prefixedProject('domain-robstoll-android')
testRuntime prefixedProject('core-robstoll-android')
testRuntimeOnly prefixedProject('domain-robstoll-android')
testRuntimeOnly prefixedProject('core-robstoll-android')

//TODO remove with 1.0.0
testImplementation prefixedProject('spec')
Expand Down
4 changes: 2 additions & 2 deletions misc/verbs/atrium-verbs-jvm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ dependencies {
api prefixedProject('core-api-jvm')

testImplementation prefixedProject('specs-jvm')
testRuntime prefixedProject('domain-robstoll-jvm')
testRuntime prefixedProject('core-robstoll-jvm')
testRuntimeOnly prefixedProject('domain-robstoll-jvm')
testRuntimeOnly prefixedProject('core-robstoll-jvm')

//TODO remove with 1.0.0
testImplementation prefixedProject('spec')
Expand Down
20 changes: 6 additions & 14 deletions samples/js/jasmine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ buildscript {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.moowork.gradle:gradle-node-plugin:1.2.0'
classpath 'com.github.node-gradle:gradle-node-plugin:2.2.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71'
}
}

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

repositories {
jcenter()
Expand Down Expand Up @@ -70,14 +70,6 @@ node {
nodeModulesDir = nodeModulesParentDir
}

task installJasmine(type: NpmTask) {
// note, without the '--prefer-offline' it works only if you are online,
// with '--prefer-offline' it works also offline if you have already as well in case you have already downloaded jasmine once
args = ['install', 'jasmine', '--prefer-offline']
}

task prepareJasmine(dependsOn: [compileTestKotlin2Js, populateNodeModules, installJasmine])

//either you use this task or create a testSetup.kt in your src/test with the following content
//
// // adopt to the api you use
Expand All @@ -94,8 +86,8 @@ task establishDependencyToAtrium(dependsOn: [compileTestKotlin2Js]) {
srcFile.write(newContent, 'UTF-8')
}
}
task runJasmine(type: NodeTask, group: 'Verification', dependsOn: [prepareJasmine, test, establishDependencyToAtrium]) {
script = file("$nodeModulesParentDir/node_modules/jasmine/bin/jasmine")
task runJasmine(type: NpxTask, group: 'Verification', dependsOn: [populateNodeModules, test, establishDependencyToAtrium]) {
command = "jasmine"
args = [compileTestKotlin2Js.outputFile]
}
check.dependsOn runJasmine
Expand Down Expand Up @@ -154,8 +146,8 @@ task establishDependencyFromCurrentToAtrium(dependsOn: [compileTestKotlin2Js]) {
srcFile.write(newContent, 'UTF-8')
}
}
task runJasmineForCurrent(type: NodeTask, group: 'Verification', dependsOn: [compileCurrentKotlin2Js, populateCurrentNodeModules, installJasmine, establishDependencyFromCurrentToAtrium]) {
script = file("$nodeModulesParentDir/node_modules/jasmine/bin/jasmine")
task runJasmineForCurrent(type: NpxTask, group: 'Verification', dependsOn: [compileCurrentKotlin2Js, populateCurrentNodeModules, establishDependencyFromCurrentToAtrium]) {
command = "jasmine"
args = [compileCurrentKotlin2Js.outputFile]
}

Expand Down
20 changes: 6 additions & 14 deletions samples/js/mocha/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ buildscript {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.moowork.gradle:gradle-node-plugin:1.2.0'
classpath 'com.github.node-gradle:gradle-node-plugin:2.2.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71'
}
}

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

repositories {
jcenter()
Expand Down Expand Up @@ -70,14 +70,6 @@ node {
nodeModulesDir = nodeModulesParentDir
}

task installMocha(type: NpmTask) {
// note, without the '--prefer-offline' it works only if you are online,
// with '--prefer-offline' it works also offline if you have already as well in case you have already downloaded mocha once
args = ['install', 'mocha', '--prefer-offline']
}

task prepareMocha(dependsOn: [compileTestKotlin2Js, populateNodeModules, installMocha])

//either you use this task or create a testSetup.kt in your src/test with the following content
//
// // adopt to the api you use
Expand All @@ -94,8 +86,8 @@ task establishDependencyToAtrium(dependsOn: [compileTestKotlin2Js]) {
srcFile.write(newContent, 'UTF-8')
}
}
task runMocha(type: NodeTask, group: 'Verification', dependsOn: [prepareMocha, test, establishDependencyToAtrium]) {
script = file("$nodeModulesParentDir/node_modules/mocha/bin/mocha")
task runMocha(type: NpxTask, group: 'Verification', dependsOn: [compileTestKotlin2Js, populateNodeModules, test, establishDependencyToAtrium]) {
command = "mocha"
args = [compileTestKotlin2Js.outputFile]
}
check.dependsOn runMocha
Expand Down Expand Up @@ -154,8 +146,8 @@ task establishDependencyFromCurrentToAtrium(dependsOn: [compileTestKotlin2Js]) {
srcFile.write(newContent, 'UTF-8')
}
}
task runMochaForCurrent(type: NodeTask, group: 'Verification', dependsOn: [compileCurrentKotlin2Js, populateCurrentNodeModules, installMocha, establishDependencyFromCurrentToAtrium]) {
script = file("$nodeModulesParentDir/node_modules/mocha/bin/mocha")
task runMochaForCurrent(type: NpxTask, group: 'Verification', dependsOn: [compileCurrentKotlin2Js, populateCurrentNodeModules, establishDependencyFromCurrentToAtrium]) {
command = "mocha"
args = [compileCurrentKotlin2Js.outputFile]
}

Expand Down
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.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 2 additions & 3 deletions samples/jvm/spek/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon Oct 21 02:29:44 IST 2019
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import java.util.*
* The tests and error message are written here and automatically placed into the README via generation.
* The generation is done during the project built. To trigger it manually, you have to use:
* ```
* ./gr :readme-examples:build
* ./gradlew :readme-examples:build
* ```
*
* There are currently three kind of tags supported:
Expand Down