diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml index 98a831b..64fbb4d 100644 --- a/.github/workflows/bld.yml +++ b/.github/workflows/bld.yml @@ -9,13 +9,12 @@ env: jobs: build-bld-project: + runs-on: ubuntu-latest + strategy: matrix: java-version: [17, 21, 24] kotlin-version: [1.9.25, 2.1.20] - os: [ ubuntu-latest, windows-latest, macos-latest ] - - runs-on: ${{ matrix.os }} steps: - name: Checkout source repository @@ -29,24 +28,6 @@ jobs: distribution: "zulu" java-version: ${{ matrix.java-version }} - - name: Download dependencies [bld example] - working-directory: examples/bld - run: ./bld download - - - name: Compile and run [bld examples] - working-directory: examples/bld - run: | - ./bld compile run - ./bld run-java - - - name: Run example [bld examples] - working-directory: examples/gradle - if: matrix.java-version != '24' - run: | - ./gradlew run - ./gradlew runJava - - - name: Download dependencies run: ./bld download @@ -58,12 +39,11 @@ jobs: - name: Remove pom.xml if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN - run: rm -rf pom.xmlAdd debug logging + run: rm -rf pom.xml - name: SonarCloud Scan uses: sonarsource/sonarcloud-github-action@master if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN - && martix.os == 'unbuntu-latest' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/examples/bld/lib/bld/bld-wrapper.properties b/examples/bld/lib/bld/bld-wrapper.properties index 1f1009d..1ffe3ff 100644 --- a/examples/bld/lib/bld/bld-wrapper.properties +++ b/examples/bld/lib/bld/bld-wrapper.properties @@ -1,7 +1,7 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true bld.downloadLocation= -bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.1.0-SNAPSHOT +bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.4 bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.sourceDirectories= bld.version=2.2.1 diff --git a/examples/gradle/build.gradle.kts b/examples/gradle/build.gradle.kts index 626d902..d1cd136 100644 --- a/examples/gradle/build.gradle.kts +++ b/examples/gradle/build.gradle.kts @@ -15,7 +15,7 @@ repositories { } dependencies { - implementation("net.thauvin.erik:cryptoprice:1.0.3-SNAPSHOT") + implementation("net.thauvin.erik:cryptoprice:1.0.2") implementation("org.json:json:20240303") } diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties index fc9463a..154abb0 100644 --- a/lib/bld/bld-wrapper.properties +++ b/lib/bld/bld-wrapper.properties @@ -1,10 +1,10 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true bld.downloadLocation= -bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.10-SNAPSHOT -bld.extension-dokka=com.uwyn.rife2:bld-dokka:1.0.4-SNAPSHOT -bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.10-SNAPSHOT -bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.1.0-SNAPSHOT +bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.9 +bld.extension-dokka=com.uwyn.rife2:bld-dokka:1.0.3 +bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.9 +bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.4 bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.sourceDirectories= bld.version=2.2.1 diff --git a/src/bld/java/net/thauvin/erik/crypto/CryptoPriceBuild.java b/src/bld/java/net/thauvin/erik/crypto/CryptoPriceBuild.java index f8df8ed..c3b1c12 100644 --- a/src/bld/java/net/thauvin/erik/crypto/CryptoPriceBuild.java +++ b/src/bld/java/net/thauvin/erik/crypto/CryptoPriceBuild.java @@ -121,9 +121,10 @@ public class CryptoPriceBuild extends Project { @BuildCommand(summary = "Compiles the Kotlin project") @Override public void compile() throws Exception { + final var options = new CompileOptions().jvmOptions("--enable-native-access=ALL-UNNAMED"); new CompileKotlinOperation() .fromProject(this) - .compileOptions(new CompileOptions().verbose(true)) + .compileOptions(options) .execute(); } diff --git a/src/main/kotlin/net/thauvin/erik/crypto/CryptoPrice.kt b/src/main/kotlin/net/thauvin/erik/crypto/CryptoPrice.kt index 578efe5..3d90e21 100644 --- a/src/main/kotlin/net/thauvin/erik/crypto/CryptoPrice.kt +++ b/src/main/kotlin/net/thauvin/erik/crypto/CryptoPrice.kt @@ -42,8 +42,6 @@ import java.math.BigDecimal import java.text.NumberFormat import java.time.LocalDate import java.util.* -import java.util.logging.Level -import java.util.logging.Logger /** * Retrieves and holds a cryptocurrency price. @@ -59,9 +57,6 @@ open class CryptoPrice(val base: String, val currency: String, val amount: BigDe // Coinbase API URL private const val COINBASE_API_URL = "https://api.coinbase.com/v2/" - /** The logger instance. **/ - val logger: Logger by lazy { Logger.getLogger(CryptoPrice::class.java.simpleName) } - /** * Converts JSON data object to [CryptoPrice]. * @@ -110,9 +105,6 @@ open class CryptoPrice(val base: String, val currency: String, val amount: BigDe id = "empty_response", message = "Empty response." ) - if (logger.isLoggable(Level.FINE)) { - logger.fine(body) - } try { val json = JSONObject(body) if (response.isSuccessful) { diff --git a/src/test/kotlin/net/thauvin/erik/crypto/CryptoPriceTest.kt b/src/test/kotlin/net/thauvin/erik/crypto/CryptoPriceTest.kt index fcc64f2..ce539b5 100644 --- a/src/test/kotlin/net/thauvin/erik/crypto/CryptoPriceTest.kt +++ b/src/test/kotlin/net/thauvin/erik/crypto/CryptoPriceTest.kt @@ -42,12 +42,9 @@ import net.thauvin.erik.crypto.CryptoPrice.Companion.sellPrice import net.thauvin.erik.crypto.CryptoPrice.Companion.spotPrice import net.thauvin.erik.crypto.CryptoPrice.Companion.toPrice import org.json.JSONObject -import org.junit.jupiter.api.BeforeAll import java.math.BigDecimal import java.time.LocalDate import java.util.* -import java.util.logging.ConsoleHandler -import java.util.logging.Level import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFailsWith @@ -242,16 +239,4 @@ class CryptoPriceTest { assertEquals(json, price.toString(), "toString()") assertEquals(price.toString(), price.toJson(""), "toString() = toJson('')") } - - companion object { - @JvmStatic - @BeforeAll - fun beforeAll() { - with(CryptoPrice.logger) { - addHandler(ConsoleHandler().apply { level = Level.FINE }) - level = Level.FINE - useParentHandlers = false - } - } - } }