File tree 5 files changed +26
-10
lines changed
src/main/java/org/bitcoinj/secp/api
5 files changed +26
-10
lines changed Original file line number Diff line number Diff line change 37
37
- name : Install secp256k1 with Nix
38
38
run : nix profile install nixpkgs#secp256k1
39
39
- name : Build with Gradle
40
- run : ./gradlew build
40
+ run : ./gradlew -PapiModuleJavaCompatibility=8 build
41
41
- name : Run Java & Kotlin Examples
42
- run : ./gradlew run runEcdsa
42
+ run : ./gradlew -PapiModuleJavaCompatibility=8 run runEcdsa
43
43
44
44
45
45
build_nix :
59
59
- name : Install secp256k1 with Nix
60
60
run : nix profile install nixpkgs#secp256k1
61
61
- name : Build in Nix development shell
62
- run : nix develop -c gradle build run runEcdsa
62
+ run : nix develop -c gradle -PapiModuleJavaCompatibility=8 build run runEcdsa
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ nixos-devshell:
10
10
- echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
11
11
- nix profile install nixpkgs#secp256k1
12
12
script :
13
- - nix develop .#minimum -c gradle build run runEcdsa
13
+ - nix develop .#minimum -c gradle -PapiModuleJavaCompatibility=8 build run runEcdsa
14
14
cache :
15
15
key : " ${CI_COMMIT_REF_SLUG}"
16
16
paths :
@@ -26,4 +26,4 @@ trixie-gradlew:
26
26
- echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
27
27
- nix profile install nixpkgs#secp256k1
28
28
script :
29
- - ./gradlew build run runEcdsa
29
+ - ./gradlew -PapiModuleJavaCompatibility=8 build run runEcdsa
Original file line number Diff line number Diff line change 1
1
plugins {
2
2
id ' java-library'
3
+ id ' org.beryx.jar' version ' 2.0.0'
3
4
}
4
5
5
6
tasks. withType(JavaCompile ). configureEach {
6
- options. release = 9
7
+ // IDEs and other tools will see `9` by default, but CI and release builds
8
+ // will set `-PapiModuleJavaCompatibility=8` to generate a Java 8 JAR
9
+ // and the `org.beryx.jar` plugin will put `module-info.jar` in the Java 8 JAR.
10
+ options. release = (findProperty(' apiModuleJavaCompatibility' ) ?: 9 ) as int
7
11
}
8
12
9
13
ext. moduleName = ' org.bitcoinj.secp.api'
10
14
15
+ moduleConfig {
16
+ version = project. version
17
+ }
18
+
11
19
dependencies {
12
20
api(" org.jspecify:jspecify:1.0.0" )
13
21
}
Original file line number Diff line number Diff line change 19
19
import java .util .Optional ;
20
20
import java .util .ServiceLoader ;
21
21
import java .util .function .Predicate ;
22
+ import java .util .stream .StreamSupport ;
22
23
23
24
/**
24
25
*
@@ -65,8 +66,7 @@ static Secp256k1Provider find() {
65
66
*/
66
67
static Optional <Secp256k1Provider > findFirst (Predicate <Secp256k1Provider > filter ) {
67
68
ServiceLoader <Secp256k1Provider > loader = ServiceLoader .load (Secp256k1Provider .class );
68
- return loader .stream ()
69
- .map (ServiceLoader .Provider ::get )
69
+ return StreamSupport .stream (loader .spliterator (),false )
70
70
.filter (filter )
71
71
.findFirst ();
72
72
}
@@ -76,7 +76,7 @@ static Optional<Secp256k1Provider> findFirst(Predicate<Secp256k1Provider> filter
76
76
* @param provider a candidate provider
77
77
* @return true if it should be "found"
78
78
*/
79
- private static boolean defaultFilter (Secp256k1Provider provider ) {
79
+ /* private */ static boolean defaultFilter (Secp256k1Provider provider ) {
80
80
return provider .name ().equals ("ffm" );
81
81
}
82
82
}
Original file line number Diff line number Diff line change 1
1
plugins {
2
2
id ' java-library'
3
+ id ' org.beryx.jar' version ' 2.0.0'
3
4
}
4
5
5
6
tasks. withType(JavaCompile ). configureEach {
6
- options. release = 9
7
+ // IDEs and other tools will see `9` by default, but CI and release builds
8
+ // will set `-PapiModuleJavaCompatibility=8` to generate a Java 8 JAR
9
+ // and the `org.beryx.jar` plugin will put `module-info.jar` in the Java 8 JAR.
10
+ options. release = (findProperty(' apiModuleJavaCompatibility' ) ?: 9 ) as int
7
11
}
8
12
9
13
ext. moduleName = ' org.bitcoinj.secp.bouncy'
10
14
15
+ moduleConfig {
16
+ version = project. version
17
+ }
18
+
11
19
dependencies {
12
20
api project(' :secp-api' )
13
21
api ' org.bouncycastle:bcprov-jdk18on:1.78.1' // TODO: Make this a non-API dependency, see BouncyPrivKey
You can’t perform that action at this time.
0 commit comments