Skip to content

Commit 422f2e8

Browse files
Merge pull request #56 from rondlh/development
Upgrade full project to Gradle 8.13, requires Java 17
2 parents 95c9e34 + 4df0ccc commit 422f2e8

File tree

5 files changed

+233
-225
lines changed

5 files changed

+233
-225
lines changed

build.gradle

Lines changed: 30 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,33 @@
1-
buildscript {
2-
ext {
3-
springBootVersion = '1.2.7.RELEASE'
4-
}
5-
repositories {
6-
[
7-
maven {
8-
url "https://repo1.maven.org/maven2/"
9-
},
10-
mavenCentral(),
11-
maven {
12-
url "https://plugins.gradle.org/m2/"
13-
},
14-
mavenLocal()
15-
]
16-
}
17-
18-
dependencies {
19-
classpath 'com.gradleup.shadow:shadow-gradle-plugin:8.3.9'
20-
}
21-
// dependencies {
22-
// classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
23-
// classpath('io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE')
24-
// }commons-io
1+
plugins {
2+
id 'java'
3+
id 'java-library'
4+
id 'signing'
5+
id 'maven-publish'
6+
id 'com.gradleup.shadow' version '8.3.9'
257
}
268

27-
apply plugin: 'com.gradleup.shadow'
28-
29-
apply plugin: 'java'
30-
apply plugin: 'signing'
31-
if (project == rootProject) {
32-
apply plugin: 'maven'
9+
tasks.withType(JavaCompile).configureEach {
10+
options.encoding = 'UTF-8'
3311
}
34-
apply plugin: 'java-library'
35-
3612

37-
//apply plugin: 'spring-boot'
38-
//apply plugin: 'io.spring.dependency-management'
13+
//java {
14+
// toolchain {
15+
// languageVersion = JavaLanguageVersion.of(17)
16+
// }
17+
//}
3918

40-
41-
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
42-
sourceSets {
43-
44-
test {
45-
java {
46-
srcDirs = [
47-
"test/java/src" ] // Note @Peter's comment below
48-
}
49-
}
50-
}
51-
52-
53-
// NetBeans will automatically add "run" and "debug" tasks relying on the
54-
// "mainClass" property. You may however define the property prior executing
55-
// tasks by passing a "-PmainClass=<QUALIFIED_CLASS_NAME>" argument.
56-
//
57-
// Note however, that you may define your own "run" and "debug" task if you
58-
// prefer. In this case NetBeans will not add these tasks but you may rely on
59-
// your own implementation.
60-
61-
File buildDir = file(".");
62-
63-
Properties props = new Properties()
64-
props.load(new FileInputStream(buildDir.getAbsolutePath()+"/src/main/resources/com/neuronrobotics/bowlerkernel/build.properties"))
19+
def props = new Properties()
20+
file('src/main/resources/com/neuronrobotics/bowlerkernel/build.properties')
21+
.withInputStream { props.load(it) }
6522

6623
boolean is64Bit() {
6724
////System.out.println("Arch: "+getOsArch());
6825
return getOsArch().startsWith("x86_64") || getOsArch().startsWith("amd64");
6926
}
27+
7028
boolean isARM() {
7129
return getOsArch().startsWith("arm");
30+
7231
}
7332
boolean isCortexA8(){
7433
if(isARM()){
@@ -77,6 +36,7 @@ boolean isCortexA8(){
7736
}
7837
return false;
7938
}
39+
8040
boolean isWindows() {
8141
////System.out.println("OS name: "+getOsName());
8242
return getOsName().toLowerCase().startsWith("windows") ||getOsName().toLowerCase().startsWith("microsoft") || getOsName().toLowerCase().startsWith("ms");
@@ -114,8 +74,6 @@ String getOsArch() {
11474
return System.getProperty("os.arch");
11575
}
11676

117-
118-
11977
repositories {
12078
mavenCentral()
12179
maven {
@@ -126,7 +84,6 @@ repositories {
12684

12785
maven { url 'https://repo1.maven.org/maven2/'}
12886

129-
13087
// maven {
13188
// url "https://repo.myrobotlab.org/artifactory/myrobotlab/"
13289
// content {
@@ -336,8 +293,6 @@ jar {
336293
"Implementation-Title": props."app.name",
337294
"Implementation-Version" : props."app.version",
338295
"Implementation-Vendor": "CommonWealth Robotics Cooperative"
339-
340-
341296
)
342297
}
343298
}
@@ -346,8 +301,8 @@ shadowJar {
346301
zip64 true
347302
//mainClassName = 'com.neuronrobotics.bowlerstudio.BowlerKernel'
348303
if (project == rootProject) {
349-
baseName = 'bowler-kernel'
350-
classifier = ""
304+
archiveBaseName = 'bowler-kernel'
305+
archiveClassifier = ""
351306
}else {
352307
archiveBaseName.set('bowler-kernel')
353308
archiveClassifier.set('')
@@ -357,36 +312,28 @@ shadowJar {
357312
}
358313

359314
group = "com.neuronrobotics"
360-
archivesBaseName = "bowler-script-kernel"
315+
316+
base {
317+
archivesName = "bowler-script-kernel"
318+
}
361319

362320
task javadocJar(type: Jar) {
363321
if (project == rootProject)
364-
classifier = 'javadoc'
322+
archiveClassifier = 'javadoc'
365323
from javadoc
366324
}
367325

368326
task sourcesJar(type: Jar) {
369327
if (project == rootProject)
370-
classifier = 'sources'
328+
archiveClassifier = 'sources'
371329
from sourceSets.main.allSource
372330
}
373331

374332
artifacts {
375333
archives javadocJar, sourcesJar, jar
376334
}
377-
test {
378-
testLogging {
379-
// Show standard out and standard error of the test JVM(s) on the console
380-
showStandardStreams = false
381-
382-
// Show which tests are being run
383-
events "passed", "skipped", "failed"
384335

385-
// Show exceptions in full
386-
exceptionFormat "full"
387-
388-
// Show causes of exceptions
389-
showCauses true
390-
showStackTraces true
391-
}
336+
test {
337+
testLogging.showExceptions = true
338+
testLogging.showCauses = true
392339
}

gradle/wrapper/gradle-wrapper.jar

-14.6 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)