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
6623boolean is64Bit () {
6724 // //System.out.println("Arch: "+getOsArch());
6825 return getOsArch(). startsWith(" x86_64" ) || getOsArch(). startsWith(" amd64" );
6926}
27+
7028boolean isARM () {
7129 return getOsArch(). startsWith(" arm" );
30+
7231}
7332boolean isCortexA8 (){
7433 if (isARM()){
@@ -77,6 +36,7 @@ boolean isCortexA8(){
7736 }
7837 return false ;
7938}
39+
8040boolean 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-
11977repositories {
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
359314group = " com.neuronrobotics"
360- archivesBaseName = " bowler-script-kernel"
315+
316+ base {
317+ archivesName = " bowler-script-kernel"
318+ }
361319
362320task javadocJar (type : Jar ) {
363321 if (project == rootProject)
364- classifier = ' javadoc'
322+ archiveClassifier = ' javadoc'
365323 from javadoc
366324}
367325
368326task sourcesJar (type : Jar ) {
369327 if (project == rootProject)
370- classifier = ' sources'
328+ archiveClassifier = ' sources'
371329 from sourceSets. main. allSource
372330}
373331
374332artifacts {
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}
0 commit comments