From ea4b0287c2f4d7efb7e3ae8ac4ad2a35207737eb Mon Sep 17 00:00:00 2001 From: Mark Perry Date: Fri, 11 Feb 2022 22:16:46 +1000 Subject: [PATCH 01/10] Make FJ6 use Java 11 --- .travis.yml | 2 -- build.gradle | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index fa0798a4..762abd7d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ sudo: false language: java jdk: - - openjdk8 - openjdk11 - openjdk-ea @@ -21,7 +20,6 @@ matrix: && ./gradlew uploadArchives' allow_failures: - - jdk: openjdk10 - jdk: openjdk-ea script: diff --git a/build.gradle b/build.gradle index 70485ec9..8a5a0601 100644 --- a/build.gradle +++ b/build.gradle @@ -42,11 +42,11 @@ allprojects { ext { isSnapshot = true - fjBaseVersion = "5.1" + fjBaseVersion = "6.0" snapshotAppendix = "-SNAPSHOT" fjVersion = fjBaseVersion + (isSnapshot ? snapshotAppendix : "") - fjConsumeVersion = "4.9" + fjConsumeVersion = "5.0" signModule = false From 338999b8a549539dfee761341cb13e7bfae84ca6 Mon Sep 17 00:00:00 2001 From: Mark Perry Date: Fri, 11 Feb 2022 22:25:49 +1000 Subject: [PATCH 02/10] Setup FJ 7.0 using JDK 17 --- .travis.yml | 5 +---- build.gradle | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index fa0798a4..bdaafe7d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,15 +4,13 @@ sudo: false language: java jdk: - - openjdk8 - - openjdk11 + - openjdk17 - openjdk-ea matrix: fast_finish: true include: - - jdk: openjdk12 script: - ./gradlew build coverage -s -i after_success: @@ -21,7 +19,6 @@ matrix: && ./gradlew uploadArchives' allow_failures: - - jdk: openjdk10 - jdk: openjdk-ea script: diff --git a/build.gradle b/build.gradle index 70485ec9..af324cb9 100644 --- a/build.gradle +++ b/build.gradle @@ -42,11 +42,11 @@ allprojects { ext { isSnapshot = true - fjBaseVersion = "5.1" + fjBaseVersion = "7.0" snapshotAppendix = "-SNAPSHOT" fjVersion = fjBaseVersion + (isSnapshot ? snapshotAppendix : "") - fjConsumeVersion = "4.9" + fjConsumeVersion = "5.0" signModule = false From 7df943c3d83b4b8c516c7ef5e3f0b4f57370bf4b Mon Sep 17 00:00:00 2001 From: Mark Perry Date: Fri, 11 Feb 2022 23:51:20 +1000 Subject: [PATCH 03/10] Upgraded some libraries identified by gradlew dependencyUpdates --- .travis.yml | 4 ++-- build.gradle | 10 +++++----- core/build.gradle | 2 +- core/src/test/java/fj/ClassTest.java | 3 +-- core/src/test/java/fj/DigitTest.java | 2 +- core/src/test/java/fj/FFunctionsTest.java | 1 + core/src/test/java/fj/MonoidTest.java | 3 ++- core/src/test/java/fj/OrderingTest.java | 2 ++ core/src/test/java/fj/PTest.java | 3 ++- core/src/test/java/fj/TryEffectTest.java | 3 ++- core/src/test/java/fj/TryTest.java | 2 +- core/src/test/java/fj/control/db/TestDbState.java | 2 +- .../test/java/fj/control/parallel/StrategyTest.java | 2 +- core/src/test/java/fj/data/ArrayTest.java | 3 ++- core/src/test/java/fj/data/BooleansTest.java | 4 +++- core/src/test/java/fj/data/DListTest.java | 3 ++- core/src/test/java/fj/data/IOFunctionsTest.java | 9 +++++---- core/src/test/java/fj/data/LazyStringTest.java | 3 ++- core/src/test/java/fj/data/ListBufferTest.java | 3 ++- core/src/test/java/fj/data/ListTest.java | 3 +++ core/src/test/java/fj/data/List_Traverse_Tests.java | 3 ++- core/src/test/java/fj/data/SetTest.java | 3 ++- core/src/test/java/fj/data/StreamTest.java | 3 ++- core/src/test/java/fj/data/TreeMapTest.java | 3 ++- core/src/test/java/fj/data/TreeTest.java | 3 ++- core/src/test/java/fj/data/TreeZipperTest.java | 3 ++- core/src/test/java/fj/data/ValidationTest.java | 3 ++- core/src/test/java/fj/data/ZipperTest.java | 2 +- core/src/test/java/fj/data/hamt/HamtTest.java | 3 ++- core/src/test/java/fj/data/optic/IsoTest.java | 3 ++- core/src/test/java/fj/data/optic/LensTest.java | 3 ++- core/src/test/java/fj/data/optic/OptionalTest.java | 3 ++- core/src/test/java/fj/data/optic/PrismTest.java | 2 +- core/src/test/java/fj/data/optic/TraversalTest.java | 2 +- core/src/test/java/fj/data/vector/VTest.java | 3 ++- core/src/test/java/fj/function/DoublesTest.java | 2 ++ core/src/test/java/fj/function/IntegersTest.java | 2 ++ core/src/test/java/fj/function/LongsTest.java | 2 ++ core/src/test/java/fj/function/StringsTest.java | 2 ++ core/src/test/java/fj/function/VisitorTest.java | 3 ++- core/src/test/java/fj/parser/ParserTest.java | 2 ++ props-core/src/test/java/fj/data/ReaderTest.java | 2 +- .../test/java/fj/data/fingertrees/FingerTreeTest.java | 2 +- 43 files changed, 82 insertions(+), 44 deletions(-) diff --git a/.travis.yml b/.travis.yml index 762abd7d..6dcdd202 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,12 +11,12 @@ matrix: fast_finish: true include: - - jdk: openjdk12 + - jdk: openjdk11 script: - ./gradlew build coverage -s -i after_success: - bash <(curl -s https://codecov.io/bash) - - '[ "$TRAVIS_BRANCH" = "series/5.x" -a "$TRAVIS_PULL_REQUEST" = "false" -a -z "$TRAVIS_TAG" ] + - '[ "$TRAVIS_BRANCH" = "series/6.x" -a "$TRAVIS_PULL_REQUEST" = "false" -a -z "$TRAVIS_TAG" ] && ./gradlew uploadArchives' allow_failures: diff --git a/build.gradle b/build.gradle index 8a5a0601..3b0f56eb 100644 --- a/build.gradle +++ b/build.gradle @@ -11,8 +11,8 @@ buildscript { } dependencies { - classpath "com.github.ben-manes:gradle-versions-plugin:0.27.0" - classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:5.3.0" + classpath "com.github.ben-manes:gradle-versions-plugin:0.36.0" + classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:6.1.0" } wrapper { @@ -46,7 +46,7 @@ allprojects { snapshotAppendix = "-SNAPSHOT" fjVersion = fjBaseVersion + (isSnapshot ? snapshotAppendix : "") - fjConsumeVersion = "5.0" + fjConsumeVersion = "4.9" signModule = false @@ -66,8 +66,8 @@ allprojects { sonatypeUploadUrl = isSnapshot ? sonatypeSnapshotUrl : sonatypeReleaseUrl primaryEmail = "functionaljava@googlegroups.com" - junitCompile = "junit:junit:4.12" - junitRuntime = "org.junit.vintage:junit-vintage-engine:5.5.2" + junitCompile = "junit:junit:4.13.2" + junitRuntime = "org.junit.vintage:junit-vintage-engine:5.8.2" displayCompilerWarnings = true generateTestReports = false diff --git a/core/build.gradle b/core/build.gradle index cbdad60b..9ee293a9 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -8,7 +8,7 @@ archivesBaseName = project.projectName dependencies { testCompile junitCompile testRuntime junitRuntime - testCompile 'com.h2database:h2:1.4.199' + testCompile 'com.h2database:h2:2.1.210' testCompile 'commons-dbutils:commons-dbutils:1.7' } diff --git a/core/src/test/java/fj/ClassTest.java b/core/src/test/java/fj/ClassTest.java index 2959e351..11085dab 100644 --- a/core/src/test/java/fj/ClassTest.java +++ b/core/src/test/java/fj/ClassTest.java @@ -8,10 +8,9 @@ import java.lang.reflect.Type; import java.util.Collection; -import java.util.Iterator; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; public class ClassTest { @Test diff --git a/core/src/test/java/fj/DigitTest.java b/core/src/test/java/fj/DigitTest.java index 9fc98d4c..13169aca 100644 --- a/core/src/test/java/fj/DigitTest.java +++ b/core/src/test/java/fj/DigitTest.java @@ -5,7 +5,7 @@ import static fj.data.Array.range; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public class DigitTest { @Test diff --git a/core/src/test/java/fj/FFunctionsTest.java b/core/src/test/java/fj/FFunctionsTest.java index b235ff67..6e20f5ab 100644 --- a/core/src/test/java/fj/FFunctionsTest.java +++ b/core/src/test/java/fj/FFunctionsTest.java @@ -5,6 +5,7 @@ import org.junit.Test; import static org.hamcrest.core.Is.is; import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; public class FFunctionsTest { diff --git a/core/src/test/java/fj/MonoidTest.java b/core/src/test/java/fj/MonoidTest.java index 1156e729..f03b16aa 100644 --- a/core/src/test/java/fj/MonoidTest.java +++ b/core/src/test/java/fj/MonoidTest.java @@ -8,7 +8,8 @@ import static fj.data.Option.some; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class MonoidTest { diff --git a/core/src/test/java/fj/OrderingTest.java b/core/src/test/java/fj/OrderingTest.java index 9b980e67..9ae8cfe3 100644 --- a/core/src/test/java/fj/OrderingTest.java +++ b/core/src/test/java/fj/OrderingTest.java @@ -9,6 +9,8 @@ import static fj.Ordering.LT; import static org.hamcrest.core.Is.is; import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; + public class OrderingTest { diff --git a/core/src/test/java/fj/PTest.java b/core/src/test/java/fj/PTest.java index 2a97303f..02d6e70b 100644 --- a/core/src/test/java/fj/PTest.java +++ b/core/src/test/java/fj/PTest.java @@ -4,7 +4,8 @@ import static fj.Function.identity; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class PTest { @Test diff --git a/core/src/test/java/fj/TryEffectTest.java b/core/src/test/java/fj/TryEffectTest.java index ea92b8f2..e45fb172 100644 --- a/core/src/test/java/fj/TryEffectTest.java +++ b/core/src/test/java/fj/TryEffectTest.java @@ -4,8 +4,9 @@ import fj.function.TryEffect0; import fj.function.TryEffect1; import org.junit.Test; + +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.*; public class TryEffectTest { diff --git a/core/src/test/java/fj/TryTest.java b/core/src/test/java/fj/TryTest.java index bd94e986..46fb2dd3 100644 --- a/core/src/test/java/fj/TryTest.java +++ b/core/src/test/java/fj/TryTest.java @@ -5,7 +5,7 @@ import org.junit.Test; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public class TryTest { diff --git a/core/src/test/java/fj/control/db/TestDbState.java b/core/src/test/java/fj/control/db/TestDbState.java index 188eae3d..2a942e1a 100644 --- a/core/src/test/java/fj/control/db/TestDbState.java +++ b/core/src/test/java/fj/control/db/TestDbState.java @@ -9,7 +9,7 @@ import java.sql.*; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public class TestDbState { @Test diff --git a/core/src/test/java/fj/control/parallel/StrategyTest.java b/core/src/test/java/fj/control/parallel/StrategyTest.java index 0c605829..1f5e7bba 100644 --- a/core/src/test/java/fj/control/parallel/StrategyTest.java +++ b/core/src/test/java/fj/control/parallel/StrategyTest.java @@ -16,7 +16,7 @@ import static fj.control.parallel.Strategy.*; import static fj.data.Stream.range; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public class StrategyTest { diff --git a/core/src/test/java/fj/data/ArrayTest.java b/core/src/test/java/fj/data/ArrayTest.java index 5713e5c3..11683fbf 100644 --- a/core/src/test/java/fj/data/ArrayTest.java +++ b/core/src/test/java/fj/data/ArrayTest.java @@ -5,7 +5,8 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class ArrayTest { diff --git a/core/src/test/java/fj/data/BooleansTest.java b/core/src/test/java/fj/data/BooleansTest.java index 84f7676f..e5dbeb12 100644 --- a/core/src/test/java/fj/data/BooleansTest.java +++ b/core/src/test/java/fj/data/BooleansTest.java @@ -9,6 +9,8 @@ import static fj.data.List.list; import static fj.function.Booleans.isnot; import static org.hamcrest.core.Is.is; +import static org.hamcrest.MatcherAssert.assertThat; + public class BooleansTest { @@ -70,7 +72,7 @@ public void testIsNot(){ F f1 = a -> a == 4; List result = list("some", "come", "done!").filter(isnot(String::length, f1)); - Assert.assertThat(result.length(), is(1)); + assertThat(result.length(), is(1)); Assert.assertEquals(result, list("done!")); } diff --git a/core/src/test/java/fj/data/DListTest.java b/core/src/test/java/fj/data/DListTest.java index 6846ca2d..77f4db6c 100644 --- a/core/src/test/java/fj/data/DListTest.java +++ b/core/src/test/java/fj/data/DListTest.java @@ -4,7 +4,8 @@ import static fj.data.DList.*; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class DListTest { @Test diff --git a/core/src/test/java/fj/data/IOFunctionsTest.java b/core/src/test/java/fj/data/IOFunctionsTest.java index adad0d11..a463dab6 100644 --- a/core/src/test/java/fj/data/IOFunctionsTest.java +++ b/core/src/test/java/fj/data/IOFunctionsTest.java @@ -13,6 +13,7 @@ import static fj.data.Stream.nil_; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; public class IOFunctionsTest { @@ -33,8 +34,8 @@ public void close() { r -> () -> new BufferedReader(r).readLine() ); - Assert.assertThat(bracketed.run(), is("Read OK")); - Assert.assertThat(closed.get(), is(true)); + assertThat(bracketed.run(), is("Read OK")); + assertThat(closed.get(), is(true)); } @Test @@ -59,9 +60,9 @@ public void close() { bracketed.run(); fail("Exception expected"); } catch (IllegalArgumentException e) { - Assert.assertThat(e.getMessage(), is("OoO")); + assertThat(e.getMessage(), is("OoO")); } - Assert.assertThat(closed.get(), is(true)); + assertThat(closed.get(), is(true)); } @Test diff --git a/core/src/test/java/fj/data/LazyStringTest.java b/core/src/test/java/fj/data/LazyStringTest.java index 1adef2bd..060c5394 100644 --- a/core/src/test/java/fj/data/LazyStringTest.java +++ b/core/src/test/java/fj/data/LazyStringTest.java @@ -4,7 +4,8 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class LazyStringTest { diff --git a/core/src/test/java/fj/data/ListBufferTest.java b/core/src/test/java/fj/data/ListBufferTest.java index f2ed8286..784b9510 100644 --- a/core/src/test/java/fj/data/ListBufferTest.java +++ b/core/src/test/java/fj/data/ListBufferTest.java @@ -3,7 +3,8 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class ListBufferTest { diff --git a/core/src/test/java/fj/data/ListTest.java b/core/src/test/java/fj/data/ListTest.java index 9f09de0f..6ff673cd 100644 --- a/core/src/test/java/fj/data/ListTest.java +++ b/core/src/test/java/fj/data/ListTest.java @@ -32,6 +32,9 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; + + public class ListTest { @Test diff --git a/core/src/test/java/fj/data/List_Traverse_Tests.java b/core/src/test/java/fj/data/List_Traverse_Tests.java index 5b7c0d19..eee5752d 100644 --- a/core/src/test/java/fj/data/List_Traverse_Tests.java +++ b/core/src/test/java/fj/data/List_Traverse_Tests.java @@ -7,7 +7,8 @@ import static fj.data.List.list; import static fj.data.Option.some; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class List_Traverse_Tests { diff --git a/core/src/test/java/fj/data/SetTest.java b/core/src/test/java/fj/data/SetTest.java index ae65b687..eb112392 100644 --- a/core/src/test/java/fj/data/SetTest.java +++ b/core/src/test/java/fj/data/SetTest.java @@ -6,7 +6,8 @@ import static fj.data.Option.some; import static fj.Ord.intOrd; import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class SetTest { diff --git a/core/src/test/java/fj/data/StreamTest.java b/core/src/test/java/fj/data/StreamTest.java index f320f27a..31d9096e 100644 --- a/core/src/test/java/fj/data/StreamTest.java +++ b/core/src/test/java/fj/data/StreamTest.java @@ -36,7 +36,8 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class StreamTest { diff --git a/core/src/test/java/fj/data/TreeMapTest.java b/core/src/test/java/fj/data/TreeMapTest.java index 77352989..1019df7d 100644 --- a/core/src/test/java/fj/data/TreeMapTest.java +++ b/core/src/test/java/fj/data/TreeMapTest.java @@ -16,8 +16,9 @@ import static fj.data.TreeMap.iterableTreeMap; import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; + public class TreeMapTest { diff --git a/core/src/test/java/fj/data/TreeTest.java b/core/src/test/java/fj/data/TreeTest.java index fd43c852..7ccb35a5 100644 --- a/core/src/test/java/fj/data/TreeTest.java +++ b/core/src/test/java/fj/data/TreeTest.java @@ -4,7 +4,8 @@ import static fj.data.Tree.leaf; import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class TreeTest { diff --git a/core/src/test/java/fj/data/TreeZipperTest.java b/core/src/test/java/fj/data/TreeZipperTest.java index c52f4111..0d09d917 100644 --- a/core/src/test/java/fj/data/TreeZipperTest.java +++ b/core/src/test/java/fj/data/TreeZipperTest.java @@ -4,7 +4,8 @@ import static fj.data.Option.none; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class TreeZipperTest { @Test diff --git a/core/src/test/java/fj/data/ValidationTest.java b/core/src/test/java/fj/data/ValidationTest.java index 37a51bcc..e60f24bc 100644 --- a/core/src/test/java/fj/data/ValidationTest.java +++ b/core/src/test/java/fj/data/ValidationTest.java @@ -37,7 +37,8 @@ import static fj.data.Validation.*; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class ValidationTest { diff --git a/core/src/test/java/fj/data/ZipperTest.java b/core/src/test/java/fj/data/ZipperTest.java index 51c7b4ea..78d837aa 100644 --- a/core/src/test/java/fj/data/ZipperTest.java +++ b/core/src/test/java/fj/data/ZipperTest.java @@ -3,7 +3,7 @@ import org.junit.Test; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public class ZipperTest { @Test diff --git a/core/src/test/java/fj/data/hamt/HamtTest.java b/core/src/test/java/fj/data/hamt/HamtTest.java index 1e601f24..ce901e6e 100644 --- a/core/src/test/java/fj/data/hamt/HamtTest.java +++ b/core/src/test/java/fj/data/hamt/HamtTest.java @@ -12,7 +12,8 @@ import static fj.P.p; import static fj.data.List.list; import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + /** * @author Mark Perry diff --git a/core/src/test/java/fj/data/optic/IsoTest.java b/core/src/test/java/fj/data/optic/IsoTest.java index 6cace533..f9559d3f 100644 --- a/core/src/test/java/fj/data/optic/IsoTest.java +++ b/core/src/test/java/fj/data/optic/IsoTest.java @@ -5,7 +5,8 @@ import org.junit.Test; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class IsoTest { @Test diff --git a/core/src/test/java/fj/data/optic/LensTest.java b/core/src/test/java/fj/data/optic/LensTest.java index d78fa0d0..98be7fca 100644 --- a/core/src/test/java/fj/data/optic/LensTest.java +++ b/core/src/test/java/fj/data/optic/LensTest.java @@ -4,7 +4,8 @@ import org.junit.Test; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class LensTest { @Test diff --git a/core/src/test/java/fj/data/optic/OptionalTest.java b/core/src/test/java/fj/data/optic/OptionalTest.java index 07c3f79a..7fddb31b 100644 --- a/core/src/test/java/fj/data/optic/OptionalTest.java +++ b/core/src/test/java/fj/data/optic/OptionalTest.java @@ -4,7 +4,8 @@ import org.junit.Test; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class OptionalTest { @Test diff --git a/core/src/test/java/fj/data/optic/PrismTest.java b/core/src/test/java/fj/data/optic/PrismTest.java index da128d72..ce6dddb4 100644 --- a/core/src/test/java/fj/data/optic/PrismTest.java +++ b/core/src/test/java/fj/data/optic/PrismTest.java @@ -4,7 +4,7 @@ import org.junit.Test; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public class PrismTest { @Test diff --git a/core/src/test/java/fj/data/optic/TraversalTest.java b/core/src/test/java/fj/data/optic/TraversalTest.java index cadd6ccf..9cfc25cc 100644 --- a/core/src/test/java/fj/data/optic/TraversalTest.java +++ b/core/src/test/java/fj/data/optic/TraversalTest.java @@ -5,7 +5,7 @@ import org.junit.Test; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public class TraversalTest { @Test diff --git a/core/src/test/java/fj/data/vector/VTest.java b/core/src/test/java/fj/data/vector/VTest.java index 9a3709ac..34f8686c 100644 --- a/core/src/test/java/fj/data/vector/VTest.java +++ b/core/src/test/java/fj/data/vector/VTest.java @@ -5,7 +5,8 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class VTest { @Test diff --git a/core/src/test/java/fj/function/DoublesTest.java b/core/src/test/java/fj/function/DoublesTest.java index 6ba98fa2..e1591ecb 100644 --- a/core/src/test/java/fj/function/DoublesTest.java +++ b/core/src/test/java/fj/function/DoublesTest.java @@ -12,6 +12,8 @@ import static org.hamcrest.core.Is.is; import static fj.data.List.list; +import static org.hamcrest.MatcherAssert.assertThat; + public class DoublesTest { diff --git a/core/src/test/java/fj/function/IntegersTest.java b/core/src/test/java/fj/function/IntegersTest.java index 985afba9..2d0aac91 100644 --- a/core/src/test/java/fj/function/IntegersTest.java +++ b/core/src/test/java/fj/function/IntegersTest.java @@ -9,6 +9,8 @@ import static fj.data.Option.none; import static org.hamcrest.core.Is.is; import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; + public class IntegersTest { diff --git a/core/src/test/java/fj/function/LongsTest.java b/core/src/test/java/fj/function/LongsTest.java index d59fc07c..f90df0c2 100644 --- a/core/src/test/java/fj/function/LongsTest.java +++ b/core/src/test/java/fj/function/LongsTest.java @@ -9,6 +9,8 @@ import static fj.data.Option.none; import static org.hamcrest.core.Is.is; import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; + public class LongsTest { diff --git a/core/src/test/java/fj/function/StringsTest.java b/core/src/test/java/fj/function/StringsTest.java index c13e1b81..db20fd68 100644 --- a/core/src/test/java/fj/function/StringsTest.java +++ b/core/src/test/java/fj/function/StringsTest.java @@ -7,6 +7,8 @@ import static fj.function.Strings.*; import static org.junit.Assert.*; import static org.hamcrest.core.Is.is; +import static org.hamcrest.MatcherAssert.assertThat; + public class StringsTest { @Test diff --git a/core/src/test/java/fj/function/VisitorTest.java b/core/src/test/java/fj/function/VisitorTest.java index 54efcf24..1341034d 100644 --- a/core/src/test/java/fj/function/VisitorTest.java +++ b/core/src/test/java/fj/function/VisitorTest.java @@ -11,7 +11,8 @@ import static fj.data.Option.some; import static fj.function.Visitor.*; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; + public class VisitorTest { @Test diff --git a/core/src/test/java/fj/parser/ParserTest.java b/core/src/test/java/fj/parser/ParserTest.java index a3f623f5..84caaf3f 100644 --- a/core/src/test/java/fj/parser/ParserTest.java +++ b/core/src/test/java/fj/parser/ParserTest.java @@ -9,6 +9,8 @@ import static fj.parser.Result.result; import static org.hamcrest.core.Is.is; import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; + public class ParserTest { @Test diff --git a/props-core/src/test/java/fj/data/ReaderTest.java b/props-core/src/test/java/fj/data/ReaderTest.java index accc3394..770d463b 100644 --- a/props-core/src/test/java/fj/data/ReaderTest.java +++ b/props-core/src/test/java/fj/data/ReaderTest.java @@ -10,8 +10,8 @@ import static fj.test.Property.prop; import static fj.test.Property.property; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; public class ReaderTest { diff --git a/props-core/src/test/java/fj/data/fingertrees/FingerTreeTest.java b/props-core/src/test/java/fj/data/fingertrees/FingerTreeTest.java index a26fdc89..8cc94825 100644 --- a/props-core/src/test/java/fj/data/fingertrees/FingerTreeTest.java +++ b/props-core/src/test/java/fj/data/fingertrees/FingerTreeTest.java @@ -11,8 +11,8 @@ import static fj.Monoid.intMinMonoid; import static fj.data.fingertrees.FingerTree.measured; import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; import static org.hamcrest.core.Is.is; +import static org.hamcrest.MatcherAssert.assertThat; public class FingerTreeTest { From 1ea455f31b7489384b12361a5523dabd41439a0d Mon Sep 17 00:00:00 2001 From: Mark Perry Date: Sat, 12 Feb 2022 00:10:40 +1000 Subject: [PATCH 04/10] Upgrade to gradle 7.4 --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 3b0f56eb..09468e89 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ buildscript { } wrapper { - gradleVersion = "6.8.3" + gradleVersion = "7.4" distributionType = Wrapper.DistributionType.ALL } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8cf6eb5a..b1159fc5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 232d296d0c08fd835e97d80e032fbbe192226f3d Mon Sep 17 00:00:00 2001 From: Mark Perry Date: Sat, 12 Feb 2022 02:53:35 +1000 Subject: [PATCH 05/10] Moved back to Gradle 6.8.3. Moved from the library java to java-library, upgrading the compile, runtime, testRuntime and testCompile configurations as per https://docs.gradle.org/current/userguide/upgrading_version_6.html --- build.gradle | 4 ++-- consume/build.gradle | 6 +++--- core/build.gradle | 8 ++++---- demo/build.gradle | 8 ++++---- gradle/wrapper/gradle-wrapper.properties | 2 +- java-core/build.gradle | 6 +++--- performance/build.gradle | 6 +++--- props-core-scalacheck/build.gradle | 10 +++++----- props-core/build.gradle | 6 +++--- quickcheck/build.gradle | 4 ++-- 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/build.gradle b/build.gradle index 09468e89..a9cda7d0 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ buildscript { } wrapper { - gradleVersion = "7.4" + gradleVersion = "6.8.3" distributionType = Wrapper.DistributionType.ALL } } @@ -94,7 +94,7 @@ subprojects { } apply from: "$rootDir/lib.gradle" - apply plugin: "java" + apply plugin: "java-library" apply plugin: "eclipse" repositories { diff --git a/consume/build.gradle b/consume/build.gradle index 370ebfbf..45dadefb 100644 --- a/consume/build.gradle +++ b/consume/build.gradle @@ -2,8 +2,8 @@ archivesBaseName = "${project.projectName}-${project.name}" dependencies { - compile("$group:$projectName:$fjConsumeVersion") + api "$group:$projectName:$fjConsumeVersion" - testCompile junitCompile - testRuntime junitRuntime + testImplementation junitCompile + testRuntimeOnly junitRuntime } diff --git a/core/build.gradle b/core/build.gradle index 9ee293a9..48423d34 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -6,10 +6,10 @@ ext { archivesBaseName = project.projectName dependencies { - testCompile junitCompile - testRuntime junitRuntime - testCompile 'com.h2database:h2:2.1.210' - testCompile 'commons-dbutils:commons-dbutils:1.7' + testImplementation junitCompile + testRuntimeOnly junitRuntime + testImplementation 'com.h2database:h2:2.1.210' + testImplementation 'commons-dbutils:commons-dbutils:1.7' } performSigning(signingEnabled, signModule) diff --git a/demo/build.gradle b/demo/build.gradle index f19e765f..9ca77f70 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -6,10 +6,10 @@ mainClassName = "fj.demo.euler.Problem2" archivesBaseName = "${project.projectName}-${project.name}" dependencies { - compile project(":core") - compile project(":quickcheck") - testCompile junitCompile - testRuntime junitRuntime + api project(":core") + api project(":quickcheck") + api junitCompile + testImplementation junitRuntime } test { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b1159fc5..8cf6eb5a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/java-core/build.gradle b/java-core/build.gradle index e7b40bb9..2f1ab1b2 100644 --- a/java-core/build.gradle +++ b/java-core/build.gradle @@ -6,9 +6,9 @@ ext { } dependencies { - compile project(":core") - testCompile junitCompile - testRuntime junitRuntime + api project(":core") + testImplementation junitCompile + testRuntimeOnly junitRuntime } performSigning(signingEnabled, signModule) diff --git a/performance/build.gradle b/performance/build.gradle index c6f4c8a6..7efbde2e 100644 --- a/performance/build.gradle +++ b/performance/build.gradle @@ -1,6 +1,6 @@ dependencies { - compile project(":core") - testCompile junitCompile - testRuntime junitRuntime + api project(":core") + testImplementation junitCompile + testRuntimeOnly junitRuntime } diff --git a/props-core-scalacheck/build.gradle b/props-core-scalacheck/build.gradle index f26b5425..b3bdfbe0 100644 --- a/props-core-scalacheck/build.gradle +++ b/props-core-scalacheck/build.gradle @@ -11,12 +11,12 @@ ext { } dependencies { - compile project(":core") - compile "org.scala-lang:scala-library:$scalaVersion" - compile "org.scalacheck:scalacheck_$scalacheckScalaVersion:$scalacheckVersion" + api project(":core") + api "org.scala-lang:scala-library:$scalaVersion" + api "org.scalacheck:scalacheck_$scalacheckScalaVersion:$scalacheckVersion" - testCompile junitCompile - testRuntime junitRuntime + testImplementation junitCompile + testRuntimeOnly junitRuntime } tasks.withType(ScalaCompile) { diff --git a/props-core/build.gradle b/props-core/build.gradle index b991bd47..534a051b 100644 --- a/props-core/build.gradle +++ b/props-core/build.gradle @@ -2,7 +2,7 @@ archivesBaseName = "${project.projectName}-${project.name}" dependencies { - compile project(":quickcheck") - testCompile junitCompile - testRuntime junitRuntime + api project(":quickcheck") + testImplementation junitCompile + testRuntimeOnly junitRuntime } diff --git a/quickcheck/build.gradle b/quickcheck/build.gradle index 2e5dbe4c..811c12bb 100644 --- a/quickcheck/build.gradle +++ b/quickcheck/build.gradle @@ -6,8 +6,8 @@ ext { archivesBaseName = "${project.projectName}-${project.name}" dependencies { - compile project(":core") - compile junitCompile + api project(":core") + api junitCompile } performSigning(signingEnabled, signModule) From 6c77f616babd7cc498a2c2e7c787bc97a286aa12 Mon Sep 17 00:00:00 2001 From: Mark Perry Date: Sat, 12 Feb 2022 03:00:50 +1000 Subject: [PATCH 06/10] Updated version to archiveVersion to be ready for Gradle 7 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a9cda7d0..bc5e01c2 100644 --- a/build.gradle +++ b/build.gradle @@ -164,7 +164,7 @@ configure(subprojects.findAll { it.name != "props-core" }) { } jar { - version project.fjVersion + archiveVersion = project.fjVersion bnd ( 'Bundle-Name': 'Functional Java', 'Signature-Version': project.fjVersion, From 02a35cd493ab6c5d543d2afb9f330bb7138589ce Mon Sep 17 00:00:00 2001 From: Mark Perry Date: Sun, 13 Feb 2022 22:02:39 +1000 Subject: [PATCH 07/10] Upgrade plugins from maven to maven-publish --- build.gradle | 10 +++- lib.gradle | 136 ++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 111 insertions(+), 35 deletions(-) diff --git a/build.gradle b/build.gradle index bc5e01c2..df0e6b07 100644 --- a/build.gradle +++ b/build.gradle @@ -58,12 +58,20 @@ allprojects { projectUrl = "http://functionaljava.org/" scmUrl = "git://github.com/functionaljava/functionaljava.git" scmGitFile = "scm:git@github.com:functionaljava/functionaljava.git" + scmSshGitFile = "scm:git:ssh://git@github.com/functionaljava/functionaljava.git" + licenseUrl = "https://github.com/functionaljava/functionaljava/blob/master/etc/LICENCE" + licenseName = "The BSD3 License" + + issueUrl = "https://github.com/functionaljava/functionaljava/issues" + githubUrl = "https://github.com/functionaljava/functionaljava" sonatypeBaseUrl = "https://oss.sonatype.org" sonatypeSnapshotUrl = "$sonatypeBaseUrl/content/repositories/snapshots/" sonatypeRepositoryUrl = "$sonatypeBaseUrl/content/groups/public" sonatypeReleaseUrl = "$sonatypeBaseUrl/service/local/staging/deploy/maven2/" + sonatypeUploadUrl = isSnapshot ? sonatypeSnapshotUrl : sonatypeReleaseUrl + primaryEmail = "functionaljava@googlegroups.com" junitCompile = "junit:junit:4.13.2" @@ -139,7 +147,7 @@ task coverage(type: org.gradle.testing.jacoco.tasks.JacocoReport) { configure(subprojects.findAll { it.name != "props-core" }) { - apply plugin: "maven" + apply plugin: "maven-publish" apply plugin: "signing" apply plugin: "biz.aQute.bnd.builder" sourceCompatibility = "1.8" diff --git a/lib.gradle b/lib.gradle index 39ce7a7e..b13325b3 100644 --- a/lib.gradle +++ b/lib.gradle @@ -20,7 +20,7 @@ String findJavaCommand(String command) { Boolean doSigning(String signingAllowed, Boolean doModule) { def b = signingAllowed.trim() == "true" && doModule -// println("signModule: ${project.name} signingEnabled: $signingAllowed module: $doModule") +// println("signModule: ${project.name} signingAllowed: $signingAllowed doModule: $doModule") b } @@ -31,50 +31,118 @@ void performSigning(String signingAllowed, Boolean doModule) { } } -void configureUpload(String signingEnabled, Boolean signModule) { +def customisePom(pom, gradleProject) { + pom.withXml { + def root = asNode() - uploadArchives { - enabled = false - repositories { - mavenDeployer { - if (doSigning(signingEnabled, signModule)) { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - } + // add all items necessary for maven central publication + root.children().last() + { + resolveStrategy = Closure.DELEGATE_FIRST - repository(url: sonatypeUploadUrl) { - authentication(userName: sonatypeUsername, password: sonatypePassword) + name project.pomProjectName + description project.projectDescription + url project.projectUrl + organization { + name project.pomOrganisation + url project.projectUrl + } + issueManagement { + system 'GitHub' + url project.issueUrl + } + licenses { + license { + name project.licenseName + url project.licenseUrl + distribution 'repo' } - pom { - groupId = project.group - project { - name pomProjectName - packaging 'jar' - description projectDescription - url projectUrl - organization { - name pomOrganisation - url projectUrl - } - scm { - url scmUrl - } - licenses { - license { - name "The BSD3 License" - url "https://github.com/functionaljava/functionaljava/blob/master/etc/LICENCE" - distribution 'repo' - } + } + scm { + url project.githubUrl + connection project.scmGitFile + developerConnection project.scmSshGitFile + } + } + } +} + + +void configureUpload(String signingEnabled, Boolean signModule) { + publishing { + + publications { + + mavenJava(MavenPublication) { + groupId project.group + artifactId project.name + version project.version + + from components.java + + customisePom(pom, rootProject) + + artifact sourcesJar + artifact javadocJar + + if (doSigning(signingEnabled, signModule)) { + // sign the pom + pom.withXml { + def pomFile = file("${project.buildDir}/generated-pom.xml.asc") + writeTo(pomFile) + def pomAscFile = signing.sign(pomFile).signatureFiles[0] + artifact(pomAscFile) { + classifier = null + extension = 'pom.asc' } - developers { - developer { - email primaryEmail + pomFile.delete() + } + + // sign the artifacts + project.tasks.signArchives.signatureFiles.each { + artifact(it) { + def matcher = it.file =~ /-(sources|javadoc|jre8|jre9)\.jar\.asc$/ + if (matcher.find()) { + classifier = matcher.group(1) + } else { + classifier = null } + extension = 'jar.asc' } } } + + } + + } + + repositories { + maven { + url project.sonatypeUploadUrl + credentials { + username sonatypeUsername + password sonatypePassword + } } } + + } + + + model { + tasks.publishMavenJavaPublicationToMavenLocal { + dependsOn(project.tasks.signArchives) + } + tasks.publishMavenJavaPublicationToMavenRepository { + dependsOn(project.tasks.signArchives) + } + tasks.publish { + dependsOn(project.tasks.build) + } +// tasks.install { +// dependsOn(project.tasks.build) +// } } + } ext { From 6b951706c5594d6bb7eee0e4ffb00bc967f8a5fd Mon Sep 17 00:00:00 2001 From: Mark Perry Date: Sun, 13 Feb 2022 22:50:04 +1000 Subject: [PATCH 08/10] Initial JDK 17 support --- build.gradle | 5 +- core/build.gradle | 6 +- gradle/wrapper/gradle-wrapper.properties | 2 +- java-core/build.gradle | 5 +- lib.gradle | 108 ++++++++++++----------- props-core-scalacheck/build.gradle | 2 +- quickcheck/build.gradle | 5 +- 7 files changed, 68 insertions(+), 65 deletions(-) diff --git a/build.gradle b/build.gradle index 487c69b3..4197b9a0 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ buildscript { } wrapper { - gradleVersion = "6.8.3" + gradleVersion = "7.3" distributionType = Wrapper.DistributionType.ALL } } @@ -35,7 +35,7 @@ allprojects { apply plugin: "jacoco" jacoco { - toolVersion = "0.8.2" + toolVersion = "0.8.7" } defaultTasks "build" @@ -49,6 +49,7 @@ allprojects { fjConsumeVersion = "5.0" signModule = false + uploadModule = false projectTitle = "Functional Java" projectName = "functionaljava" diff --git a/core/build.gradle b/core/build.gradle index 48423d34..282ec191 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,6 +1,8 @@ ext { signModule = true + uploadModule = true + } archivesBaseName = project.projectName @@ -13,6 +15,4 @@ dependencies { } performSigning(signingEnabled, signModule) -configureUpload(signingEnabled, signModule) - -uploadArchives.enabled = true +configureUpload(signingEnabled, signModule, uploadModule) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8cf6eb5a..fbce071a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/java-core/build.gradle b/java-core/build.gradle index 2f1ab1b2..f6a6146a 100644 --- a/java-core/build.gradle +++ b/java-core/build.gradle @@ -3,6 +3,7 @@ archivesBaseName = "${project.projectName}-${project.name}" ext { signModule = true + uploadModule = true } dependencies { @@ -12,7 +13,5 @@ dependencies { } performSigning(signingEnabled, signModule) -configureUpload(signingEnabled, signModule) +configureUpload(signingEnabled, signModule, uploadModule) - -uploadArchives.enabled = true diff --git a/lib.gradle b/lib.gradle index b13325b3..5ff91f01 100644 --- a/lib.gradle +++ b/lib.gradle @@ -67,80 +67,84 @@ def customisePom(pom, gradleProject) { } -void configureUpload(String signingEnabled, Boolean signModule) { - publishing { +void configureUpload(String signingEnabled, Boolean signModule, Boolean uploadModule) { - publications { + if (uploadModule) { - mavenJava(MavenPublication) { - groupId project.group - artifactId project.name - version project.version + publishing { - from components.java + publications { - customisePom(pom, rootProject) + mavenJava(MavenPublication) { + groupId project.group + artifactId project.name + version project.version - artifact sourcesJar - artifact javadocJar + from components.java - if (doSigning(signingEnabled, signModule)) { - // sign the pom - pom.withXml { - def pomFile = file("${project.buildDir}/generated-pom.xml.asc") - writeTo(pomFile) - def pomAscFile = signing.sign(pomFile).signatureFiles[0] - artifact(pomAscFile) { - classifier = null - extension = 'pom.asc' - } - pomFile.delete() - } + customisePom(pom, rootProject) + + artifact sourcesJar + artifact javadocJar - // sign the artifacts - project.tasks.signArchives.signatureFiles.each { - artifact(it) { - def matcher = it.file =~ /-(sources|javadoc|jre8|jre9)\.jar\.asc$/ - if (matcher.find()) { - classifier = matcher.group(1) - } else { + if (doSigning(signingEnabled, signModule)) { + // sign the pom + pom.withXml { + def pomFile = file("${project.buildDir}/generated-pom.xml.asc") + writeTo(pomFile) + def pomAscFile = signing.sign(pomFile).signatureFiles[0] + artifact(pomAscFile) { classifier = null + extension = 'pom.asc' + } + pomFile.delete() + } + + // sign the artifacts + project.tasks.signArchives.signatureFiles.each { + artifact(it) { + def matcher = it.file =~ /-(sources|javadoc|jre8|jre9)\.jar\.asc$/ + if (matcher.find()) { + classifier = matcher.group(1) + } else { + classifier = null + } + extension = 'jar.asc' } - extension = 'jar.asc' } } + } } - } - - repositories { - maven { - url project.sonatypeUploadUrl - credentials { - username sonatypeUsername - password sonatypePassword + repositories { + maven { + url project.sonatypeUploadUrl + credentials { + username sonatypeUsername + password sonatypePassword + } } } - } - } - - - model { - tasks.publishMavenJavaPublicationToMavenLocal { - dependsOn(project.tasks.signArchives) - } - tasks.publishMavenJavaPublicationToMavenRepository { - dependsOn(project.tasks.signArchives) - } - tasks.publish { - dependsOn(project.tasks.build) } + + model { + tasks.publishMavenJavaPublicationToMavenLocal { + dependsOn(project.tasks.signArchives) + } + tasks.publishMavenJavaPublicationToMavenRepository { + dependsOn(project.tasks.signArchives) + } + tasks.publish { + dependsOn(project.tasks.build) + } // tasks.install { // dependsOn(project.tasks.build) // } + } + } } diff --git a/props-core-scalacheck/build.gradle b/props-core-scalacheck/build.gradle index b3bdfbe0..358b365b 100644 --- a/props-core-scalacheck/build.gradle +++ b/props-core-scalacheck/build.gradle @@ -24,4 +24,4 @@ tasks.withType(ScalaCompile) { } performSigning(signingEnabled, signModule) -configureUpload(signingEnabled, signModule) +configureUpload(signingEnabled, signModule, project.uploadModule) diff --git a/quickcheck/build.gradle b/quickcheck/build.gradle index 811c12bb..c9851596 100644 --- a/quickcheck/build.gradle +++ b/quickcheck/build.gradle @@ -1,6 +1,7 @@ ext { signModule = true + uploadModule = true } archivesBaseName = "${project.projectName}-${project.name}" @@ -11,6 +12,4 @@ dependencies { } performSigning(signingEnabled, signModule) -configureUpload(signingEnabled, signModule) - -uploadArchives.enabled = true +configureUpload(signingEnabled, signModule, uploadModule) From e8fe3cb63c7d553ee3d38256a2fcdf32aff282ec Mon Sep 17 00:00:00 2001 From: Mark Perry Date: Sun, 13 Feb 2022 22:52:06 +1000 Subject: [PATCH 09/10] Updated Travis to branch 7.x and updated gradle publish task --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0ebb1ea6..beaf6dd9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,8 @@ matrix: - ./gradlew build coverage -s -i after_success: - bash <(curl -s https://codecov.io/bash) - - '[ "$TRAVIS_BRANCH" = "series/6.x" -a "$TRAVIS_PULL_REQUEST" = "false" -a -z "$TRAVIS_TAG" ] - && ./gradlew uploadArchives' + - '[ "$TRAVIS_BRANCH" = "series/7.x" -a "$TRAVIS_PULL_REQUEST" = "false" -a -z "$TRAVIS_TAG" ] + && ./gradlew publishMavenJavaPublicationToMavenRepository' allow_failures: - jdk: openjdk-ea From d2744315f4ad6d5ac9d2a12cb2e44c9cdd9f1fcb Mon Sep 17 00:00:00 2001 From: Mark Perry Date: Tue, 15 Feb 2022 00:08:12 +1000 Subject: [PATCH 10/10] Unify with FJ series/5.x branch --- core/src/test/java/fj/ClassTest.java | 3 ++- core/src/test/java/fj/FFunctionsTest.java | 1 - core/src/test/java/fj/MonoidTest.java | 1 - core/src/test/java/fj/OrderingTest.java | 2 -- core/src/test/java/fj/PTest.java | 1 - core/src/test/java/fj/TryEffectTest.java | 3 +-- core/src/test/java/fj/data/IOFunctionsTest.java | 2 +- core/src/test/java/fj/data/ListTest.java | 6 +++--- core/src/test/java/fj/data/SetTest.java | 1 - core/src/test/java/fj/data/StreamTest.java | 1 - core/src/test/java/fj/data/TreeMapTest.java | 3 +-- core/src/test/java/fj/data/TreeTest.java | 1 - core/src/test/java/fj/data/TreeZipperTest.java | 1 - core/src/test/java/fj/data/ValidationTest.java | 1 - core/src/test/java/fj/function/DoublesTest.java | 7 ++++--- core/src/test/java/fj/function/IntegersTest.java | 5 +++-- core/src/test/java/fj/function/LongsTest.java | 3 ++- core/src/test/java/fj/function/VisitorTest.java | 1 - core/src/test/java/fj/parser/ParserTest.java | 2 -- demo/build.gradle | 2 +- gradle.properties | 4 ++++ props-core/src/test/java/fj/data/ReaderTest.java | 3 ++- .../java/fj/data/properties/PriorityQueueProperties.java | 2 +- 23 files changed, 25 insertions(+), 31 deletions(-) diff --git a/core/src/test/java/fj/ClassTest.java b/core/src/test/java/fj/ClassTest.java index 11085dab..dfbc7f00 100644 --- a/core/src/test/java/fj/ClassTest.java +++ b/core/src/test/java/fj/ClassTest.java @@ -8,9 +8,10 @@ import java.lang.reflect.Type; import java.util.Collection; +import java.util.Iterator; -import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; +import static org.hamcrest.MatcherAssert.assertThat; public class ClassTest { @Test diff --git a/core/src/test/java/fj/FFunctionsTest.java b/core/src/test/java/fj/FFunctionsTest.java index 6e20f5ab..4f01a0db 100644 --- a/core/src/test/java/fj/FFunctionsTest.java +++ b/core/src/test/java/fj/FFunctionsTest.java @@ -4,7 +4,6 @@ import fj.data.TreeZipper; import org.junit.Test; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.*; import static org.hamcrest.MatcherAssert.assertThat; public class FFunctionsTest { diff --git a/core/src/test/java/fj/MonoidTest.java b/core/src/test/java/fj/MonoidTest.java index f03b16aa..68457f09 100644 --- a/core/src/test/java/fj/MonoidTest.java +++ b/core/src/test/java/fj/MonoidTest.java @@ -10,7 +10,6 @@ import static org.hamcrest.core.Is.is; import static org.hamcrest.MatcherAssert.assertThat; - public class MonoidTest { @Test diff --git a/core/src/test/java/fj/OrderingTest.java b/core/src/test/java/fj/OrderingTest.java index 9ae8cfe3..640bc1d3 100644 --- a/core/src/test/java/fj/OrderingTest.java +++ b/core/src/test/java/fj/OrderingTest.java @@ -8,10 +8,8 @@ import static fj.Ordering.GT; import static fj.Ordering.LT; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.*; import static org.hamcrest.MatcherAssert.assertThat; - public class OrderingTest { @Test diff --git a/core/src/test/java/fj/PTest.java b/core/src/test/java/fj/PTest.java index 02d6e70b..00220f9d 100644 --- a/core/src/test/java/fj/PTest.java +++ b/core/src/test/java/fj/PTest.java @@ -6,7 +6,6 @@ import static org.hamcrest.core.Is.is; import static org.hamcrest.MatcherAssert.assertThat; - public class PTest { @Test public void testPF(){ diff --git a/core/src/test/java/fj/TryEffectTest.java b/core/src/test/java/fj/TryEffectTest.java index e45fb172..6fd46fd1 100644 --- a/core/src/test/java/fj/TryEffectTest.java +++ b/core/src/test/java/fj/TryEffectTest.java @@ -4,9 +4,8 @@ import fj.function.TryEffect0; import fj.function.TryEffect1; import org.junit.Test; - -import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; +import static org.hamcrest.MatcherAssert.assertThat; public class TryEffectTest { diff --git a/core/src/test/java/fj/data/IOFunctionsTest.java b/core/src/test/java/fj/data/IOFunctionsTest.java index a463dab6..8ae18b1a 100644 --- a/core/src/test/java/fj/data/IOFunctionsTest.java +++ b/core/src/test/java/fj/data/IOFunctionsTest.java @@ -12,8 +12,8 @@ import static fj.data.Stream.cons; import static fj.data.Stream.nil_; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.*; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.fail; public class IOFunctionsTest { diff --git a/core/src/test/java/fj/data/ListTest.java b/core/src/test/java/fj/data/ListTest.java index 6ff673cd..720157e8 100644 --- a/core/src/test/java/fj/data/ListTest.java +++ b/core/src/test/java/fj/data/ListTest.java @@ -30,10 +30,10 @@ import static fj.data.Validation.fail; import static fj.data.Validation.*; import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.*; - +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static org.hamcrest.MatcherAssert.assertThat; - +import static org.junit.Assert.assertEquals; public class ListTest { diff --git a/core/src/test/java/fj/data/SetTest.java b/core/src/test/java/fj/data/SetTest.java index eb112392..e30d166a 100644 --- a/core/src/test/java/fj/data/SetTest.java +++ b/core/src/test/java/fj/data/SetTest.java @@ -8,7 +8,6 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; - public class SetTest { @Test diff --git a/core/src/test/java/fj/data/StreamTest.java b/core/src/test/java/fj/data/StreamTest.java index 31d9096e..febd4567 100644 --- a/core/src/test/java/fj/data/StreamTest.java +++ b/core/src/test/java/fj/data/StreamTest.java @@ -38,7 +38,6 @@ import static org.junit.Assert.assertEquals; import static org.hamcrest.MatcherAssert.assertThat; - public class StreamTest { @Test diff --git a/core/src/test/java/fj/data/TreeMapTest.java b/core/src/test/java/fj/data/TreeMapTest.java index 1019df7d..051f0773 100644 --- a/core/src/test/java/fj/data/TreeMapTest.java +++ b/core/src/test/java/fj/data/TreeMapTest.java @@ -16,9 +16,8 @@ import static fj.data.TreeMap.iterableTreeMap; import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import static org.hamcrest.MatcherAssert.assertThat; - +import static org.junit.Assert.assertTrue; public class TreeMapTest { diff --git a/core/src/test/java/fj/data/TreeTest.java b/core/src/test/java/fj/data/TreeTest.java index 7ccb35a5..a6028f37 100644 --- a/core/src/test/java/fj/data/TreeTest.java +++ b/core/src/test/java/fj/data/TreeTest.java @@ -6,7 +6,6 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; - public class TreeTest { @Test diff --git a/core/src/test/java/fj/data/TreeZipperTest.java b/core/src/test/java/fj/data/TreeZipperTest.java index 0d09d917..c2549963 100644 --- a/core/src/test/java/fj/data/TreeZipperTest.java +++ b/core/src/test/java/fj/data/TreeZipperTest.java @@ -6,7 +6,6 @@ import static org.hamcrest.core.Is.is; import static org.hamcrest.MatcherAssert.assertThat; - public class TreeZipperTest { @Test public void testDelete() { diff --git a/core/src/test/java/fj/data/ValidationTest.java b/core/src/test/java/fj/data/ValidationTest.java index e60f24bc..4505499c 100644 --- a/core/src/test/java/fj/data/ValidationTest.java +++ b/core/src/test/java/fj/data/ValidationTest.java @@ -40,7 +40,6 @@ import static org.hamcrest.MatcherAssert.assertThat; - public class ValidationTest { @Test public void testParseShort() { diff --git a/core/src/test/java/fj/function/DoublesTest.java b/core/src/test/java/fj/function/DoublesTest.java index e1591ecb..53b74e52 100644 --- a/core/src/test/java/fj/function/DoublesTest.java +++ b/core/src/test/java/fj/function/DoublesTest.java @@ -1,6 +1,8 @@ package fj.function; -import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.fail; + import fj.F; import org.junit.Test; @@ -9,11 +11,10 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import static org.junit.Assert.assertTrue; import static org.hamcrest.core.Is.is; import static fj.data.List.list; -import static org.hamcrest.MatcherAssert.assertThat; - public class DoublesTest { diff --git a/core/src/test/java/fj/function/IntegersTest.java b/core/src/test/java/fj/function/IntegersTest.java index 2d0aac91..c07197af 100644 --- a/core/src/test/java/fj/function/IntegersTest.java +++ b/core/src/test/java/fj/function/IntegersTest.java @@ -8,9 +8,10 @@ import static fj.data.List.list; import static fj.data.Option.none; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.*; -import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.fail; +import static org.junit.Assert.assertTrue; public class IntegersTest { diff --git a/core/src/test/java/fj/function/LongsTest.java b/core/src/test/java/fj/function/LongsTest.java index f90df0c2..196da20f 100644 --- a/core/src/test/java/fj/function/LongsTest.java +++ b/core/src/test/java/fj/function/LongsTest.java @@ -8,8 +8,9 @@ import static fj.data.List.list; import static fj.data.Option.none; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.*; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; public class LongsTest { diff --git a/core/src/test/java/fj/function/VisitorTest.java b/core/src/test/java/fj/function/VisitorTest.java index 1341034d..da92a4bb 100644 --- a/core/src/test/java/fj/function/VisitorTest.java +++ b/core/src/test/java/fj/function/VisitorTest.java @@ -13,7 +13,6 @@ import static org.hamcrest.core.Is.is; import static org.hamcrest.MatcherAssert.assertThat; - public class VisitorTest { @Test public void testFindFirst() { diff --git a/core/src/test/java/fj/parser/ParserTest.java b/core/src/test/java/fj/parser/ParserTest.java index 84caaf3f..f2664a1f 100644 --- a/core/src/test/java/fj/parser/ParserTest.java +++ b/core/src/test/java/fj/parser/ParserTest.java @@ -8,10 +8,8 @@ import static fj.parser.Result.result; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.*; import static org.hamcrest.MatcherAssert.assertThat; - public class ParserTest { @Test public void testParserFail() { diff --git a/demo/build.gradle b/demo/build.gradle index 9ca77f70..87bf7a5c 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -8,7 +8,7 @@ archivesBaseName = "${project.projectName}-${project.name}" dependencies { api project(":core") api project(":quickcheck") - api junitCompile + testImplementation junitCompile testImplementation junitRuntime } diff --git a/gradle.properties b/gradle.properties index 50202eda..6ee9a768 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,4 +4,8 @@ signingEnabled = false sonatypeUsername = incorrectUser sonatypePassword = incorrectPwd +#signing.keyId= +#signing.password= +#signing.secretKeyRingFile= + org.gradle.parallel = true diff --git a/props-core/src/test/java/fj/data/ReaderTest.java b/props-core/src/test/java/fj/data/ReaderTest.java index 770d463b..48352620 100644 --- a/props-core/src/test/java/fj/data/ReaderTest.java +++ b/props-core/src/test/java/fj/data/ReaderTest.java @@ -10,8 +10,9 @@ import static fj.test.Property.prop; import static fj.test.Property.property; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertTrue; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertTrue; + public class ReaderTest { diff --git a/props-core/src/test/java/fj/data/properties/PriorityQueueProperties.java b/props-core/src/test/java/fj/data/properties/PriorityQueueProperties.java index c2e46eca..5460bfdf 100644 --- a/props-core/src/test/java/fj/data/properties/PriorityQueueProperties.java +++ b/props-core/src/test/java/fj/data/properties/PriorityQueueProperties.java @@ -24,7 +24,7 @@ import static fj.test.Property.prop; import static fj.test.Property.property; import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; @RunWith(PropertyTestRunner.class) @CheckParams(maxSize = 100)