Skip to content

Commit 4da0793

Browse files
marknolanclaude
andcommitted
DEV-1013 Migrate three modules off APIs Gradle 7 removed
Aligning the wrappers is not enough on its own: ShimmerTCP, JavaShimmerConnect and ShimmerLSL still used the `compile`/`testCompile` configurations and, in ShimmerLSL's case, the `maven` plugin - all removed in Gradle 7. ShimmerTCP and JavaShimmerConnect are leaf modules that publish nothing, so `compile` becomes `implementation`. ShimmerLSL does publish, so `compile` becomes `api` (with `java-library` applied) to keep its POM dependencies in `compile` scope rather than demoting them to `runtime`. Also replaced jcenter(), shut down in 2022, with mavenCentral(), and dropped JavaShimmerConnect's dead bintray repository - bintray closed in 2021, and its plain http:// URL is rejected by Gradle 7+ anyway. ShimmerLSL declared source/targetCompatibility 1.8 while depending on ShimmerDriver, ShimmerDriverPC and ShimmerBluetoothManager, which are all built for Java 11. Gradle 2.14.1 had no variant-aware matching so never checked this; 8.14.3 does, and rejects it. The 1.8 declaration was never satisfiable - a Java 8 consumer could not have used this module - so it now states 1.11. This is the one consumer-visible change here. All seven modules now clean-build. Before this, every one of them was broken: the 6.1 modules on the Guava variant fault, ShimmerPCBasicExamples because Shadow 7.0.0 cannot be applied under Gradle 6.1, and ShimmerLSL because Gradle 2.14.1 cannot parse a JDK 11 version string. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 950406d commit 4da0793

3 files changed

Lines changed: 20 additions & 23 deletions

File tree

‎JavaShimmerConnect/build.gradle‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,30 @@ apply plugin: 'java'
1212

1313
// In this section you declare where to find the dependencies of your project
1414
repositories {
15-
// Use 'jcenter' for resolving your dependencies.
15+
// Use 'mavenCentral' for resolving your dependencies (jcenter was shut down in 2022).
1616
// You can declare any Maven/Ivy/file repository here.
17-
jcenter()
17+
mavenCentral()
1818
flatDir {
1919
dirs 'libs'
2020
}
21-
maven {
22-
url "http://dl.bintray.com/jongchern/testshimmer"
23-
}
2421
}
2522

2623
// In this section you declare the dependencies for your production and test code
2724
dependencies {
2825
// The production code uses the SLF4J logging API at compile time
29-
compile 'org.slf4j:slf4j-api:1.7.21'
26+
implementation 'org.slf4j:slf4j-api:1.7.21'
3027
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-slf4j-impl
3128
testImplementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.21.1'
3229

3330
// Declare the dependency for your favourite test framework you want to use in your tests.
3431
// TestNG is also supported by the Gradle Test task. Just change the
3532
// testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
3633
// 'test.useTestNG()' to your build script.
37-
testCompile 'junit:junit:4.12'
34+
testImplementation 'junit:junit:4.12'
3835

39-
compile project (':ShimmerDriver')
40-
compile project (':ShimmerDriverPC')
41-
compile name: 'ShimmerBiophysicalProcessingLibrary_Rev_0_11'
36+
implementation project (':ShimmerDriver')
37+
implementation project (':ShimmerDriverPC')
38+
implementation name: 'ShimmerBiophysicalProcessingLibrary_Rev_0_11'
4239
//compile 'com.shimmerresearch.driver:ShimmerDriver:0.4'
4340
//compile 'com.shimmerresearch.pcdriver:ShimmerDriverPC:1.0'
4441
}

‎ShimmerLSL/build.gradle‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apply plugin: 'java'
2+
apply plugin: 'java-library'
23
apply plugin: 'eclipse'
3-
apply plugin: 'maven'
44
apply plugin: 'maven-publish'
55

66
/*
@@ -11,8 +11,8 @@ Rev0.2
1111
//This version should match the git release tag
1212
//version = '0.9.46alpha'
1313

14-
sourceCompatibility = 1.8
15-
targetCompatibility = 1.8
14+
sourceCompatibility = 1.11
15+
targetCompatibility = 1.11
1616

1717
repositories {
1818
mavenCentral()
@@ -64,15 +64,15 @@ dependencies {
6464
//include ':ShimmerBluetoothManager'
6565
//project(':ShimmerBluetoothManager').projectDir = new File(settingsDir, '../ShimmerBluetoothManager')
6666

67-
compile project (':ShimmerDriver')
68-
compile project (':ShimmerBluetoothManager')
69-
compile project (':ShimmerDriverPC')
67+
api project (':ShimmerDriver')
68+
api project (':ShimmerBluetoothManager')
69+
api project (':ShimmerDriverPC')
7070

71-
compile 'net.java.dev.jna:jna:5.6.0'
71+
api 'net.java.dev.jna:jna:5.6.0'
7272

7373
// Declare the dependency for your favourite test framework you want to use in your tests.
7474
// TestNG is also supported by the Gradle Test task. Just change the
7575
// testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
7676
// 'test.useTestNG()' to your build script.
77-
testCompile 'junit:junit:4.12'
77+
testImplementation 'junit:junit:4.12'
7878
}

‎ShimmerTCP/build.gradle‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@ apply plugin: 'java'
1212

1313
// In this section you declare where to find the dependencies of your project
1414
repositories {
15-
// Use 'jcenter' for resolving your dependencies.
15+
// Use 'mavenCentral' for resolving your dependencies (jcenter was shut down in 2022).
1616
// You can declare any Maven/Ivy/file repository here.
17-
jcenter()
17+
mavenCentral()
1818
}
1919

2020
// In this section you declare the dependencies for your production and test code
2121
dependencies {
2222
// The production code uses the SLF4J logging API at compile time
23-
compile 'org.slf4j:slf4j-api:1.7.21'
23+
implementation 'org.slf4j:slf4j-api:1.7.21'
2424
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-slf4j-impl
2525
testImplementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.21.1'
2626

2727
// Declare the dependency for your favourite test framework you want to use in your tests.
2828
// TestNG is also supported by the Gradle Test task. Just change the
2929
// testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
3030
// 'test.useTestNG()' to your build script.
31-
testCompile 'junit:junit:4.12'
31+
testImplementation 'junit:junit:4.12'
3232

33-
compile project (':ShimmerDriver')
33+
implementation project (':ShimmerDriver')
3434

3535
}

0 commit comments

Comments
 (0)