Updated dependencies and copyright.

This commit is contained in:
Erik C. Thauvin 2022-01-03 12:24:32 -08:00
parent 191b09060b
commit 1bb9a5d1b5
17 changed files with 55 additions and 72 deletions

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -41,5 +41,10 @@
<option name="name" value="maven" /> <option name="name" value="maven" />
<option name="url" value="https://oss.sonatype.org/content/repositories/snapshots" /> <option name="url" value="https://oss.sonatype.org/content/repositories/snapshots" />
</remote-repository> </remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://packages.jetbrains.team/maven/p/ij/intellij-dependencies" />
</remote-repository>
</component> </component>
</project> </project>

8
.idea/modules.xml generated
View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/bitly-shorten.iml" filepath="$PROJECT_DIR$/.idea/bitly-shorten.iml" />
</modules>
</component>
</project>

10
.idea/runConfigurations.xml generated Normal file
View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

View file

@ -1,4 +1,4 @@
Copyright (c) 2020-2021, Erik C. Thauvin (erik@thauvin.net) Copyright (c) 2020-2022, Erik C. Thauvin (erik@thauvin.net)
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View file

@ -1,21 +1,22 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URL import java.net.URL
plugins { plugins {
id("com.github.ben-manes.versions") version "0.39.0" id("com.github.ben-manes.versions") version "0.40.0"
id("io.gitlab.arturbosch.detekt") version "1.18.1" id("io.gitlab.arturbosch.detekt") version "1.19.0"
id("jacoco")
id("java") id("java")
id("java-library") id("java-library")
id("maven-publish") id("maven-publish")
id("net.thauvin.erik.gradle.semver") version "1.0.4" id("net.thauvin.erik.gradle.semver") version "1.0.4"
id("org.jetbrains.dokka") version "1.5.30" id("org.jetbrains.dokka") version "1.6.10"
id("org.jetbrains.kotlinx.kover") version "0.4.4"
id("org.sonarqube") version "3.3" id("org.sonarqube") version "3.3"
id("signing") id("signing")
kotlin("jvm") version "1.5.31" kotlin("jvm") version "1.6.10"
kotlin("kapt") version "1.5.31" kotlin("kapt") version "1.6.10"
} }
group = "net.thauvin.erik" group = "net.thauvin.erik"
@ -31,7 +32,14 @@ var semverProcessor = "net.thauvin.erik:semver:1.2.0"
val publicationName = "mavenJava" val publicationName = "mavenJava"
object Versions { object Versions {
const val OKHTTP = "4.9.1" const val OKHTTP = "4.9.3"
}
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
} }
repositories { repositories {
@ -44,7 +52,7 @@ dependencies {
implementation("com.squareup.okhttp3:okhttp:${Versions.OKHTTP}") implementation("com.squareup.okhttp3:okhttp:${Versions.OKHTTP}")
implementation("com.squareup.okhttp3:logging-interceptor:${Versions.OKHTTP}") implementation("com.squareup.okhttp3:logging-interceptor:${Versions.OKHTTP}")
implementation("org.json:json:20210307") implementation("org.json:json:20211205")
testImplementation(kotlin("test")) testImplementation(kotlin("test"))
testImplementation(kotlin("test-junit")) testImplementation(kotlin("test-junit"))
@ -61,24 +69,6 @@ detekt {
baseline = project.rootDir.resolve("config/detekt/baseline.xml") baseline = project.rootDir.resolve("config/detekt/baseline.xml")
} }
kotlin {
// Add kapt.use.worker.api=false to gradle.properties (JDK 16+)
// See: https://youtrack.jetbrains.com/issue/KT-45545
kotlinDaemonJvmArgs = listOf(
"-Dfile.encoding=UTF-8",
"--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
"--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
"--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
"--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
"--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED",
"--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
"--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
"--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED",
"--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
"--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"
)
}
java { java {
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
@ -91,6 +81,7 @@ sonarqube {
property("sonar.organization", "ethauvin-github") property("sonar.organization", "ethauvin-github")
property("sonar.host.url", "https://sonarcloud.io") property("sonar.host.url", "https://sonarcloud.io")
property("sonar.sourceEncoding", "UTF-8") property("sonar.sourceEncoding", "UTF-8")
property("sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/kover/report.xml")
} }
} }
@ -107,6 +98,12 @@ tasks {
kotlinOptions.jvmTarget = java.targetCompatibility.toString() kotlinOptions.jvmTarget = java.targetCompatibility.toString()
} }
withType<DependencyUpdatesTask> {
rejectVersionIf {
isNonStable(candidate.version)
}
}
withType<Test> { withType<Test> {
testLogging { testLogging {
exceptionFormat = TestExceptionFormat.FULL exceptionFormat = TestExceptionFormat.FULL
@ -118,20 +115,8 @@ tasks {
destination = file("$projectDir/pom.xml") destination = file("$projectDir/pom.xml")
} }
jacoco {
toolVersion = "0.8.7"
}
jacocoTestReport {
dependsOn(test)
reports {
xml.required.set(true)
html.required.set(true)
}
}
assemble { assemble {
dependsOn(javadocJar) dependsOn(koverReport)
} }
clean { clean {
@ -206,7 +191,7 @@ tasks {
} }
"sonarqube" { "sonarqube" {
dependsOn(jacocoTestReport) dependsOn(koverReport)
} }
} }

View file

@ -2,8 +2,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
id("application") id("application")
id("com.github.ben-manes.versions") version "0.39.0" id("com.github.ben-manes.versions") version "0.40.0"
kotlin("jvm") version "1.5.31" kotlin("jvm") version "1.6.10"
} }
// ./gradlew run --args='https://erik.thauvin.net/ https://bit.ly/2PsNMAA' // ./gradlew run --args='https://erik.thauvin.net/ https://bit.ly/2PsNMAA'
@ -17,7 +17,7 @@ repositories {
dependencies { dependencies {
implementation("net.thauvin.erik:bitly-shorten:0.9.4-SNAPSHOT") implementation("net.thauvin.erik:bitly-shorten:0.9.4-SNAPSHOT")
implementation("org.json:json:20210307") implementation("org.json:json:20211205")
} }
application { application {

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View file

@ -1,7 +1,7 @@
/* /*
* Bitlinks.kt * Bitlinks.kt
* *
* Copyright (c) 2020-2021, Erik C. Thauvin (erik@thauvin.net) * Copyright (c) 2022, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View file

@ -1,7 +1,7 @@
/* /*
* Bitly.kt * Bitly.kt
* *
* Copyright (c) 2020-2021, Erik C. Thauvin (erik@thauvin.net) * Copyright (c) 2022, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View file

@ -1,7 +1,7 @@
/* /*
* Response.kt * CallResponse.kt
* *
* Copyright (c) 2020-2021, Erik C. Thauvin (erik@thauvin.net) * Copyright (c) 2022, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View file

@ -1,7 +1,7 @@
/* /*
* Constants.kt * Constants.kt
* *
* Copyright (c) 2020-2021, Erik C. Thauvin (erik@thauvin.net) * Copyright (c) 2022, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View file

@ -1,7 +1,7 @@
/* /*
* Methods.kt * Methods.kt
* *
* Copyright (c) 2020-2021, Erik C. Thauvin (erik@thauvin.net) * Copyright (c) 2022, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View file

@ -1,7 +1,7 @@
/* /*
* Units.kt * Units.kt
* *
* Copyright (c) 2020-2021, Erik C. Thauvin (erik@thauvin.net) * Copyright (c) 2022, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View file

@ -1,7 +1,7 @@
/* /*
* Utils.kt * Utils.kt
* *
* Copyright (c) 2020-2021, Erik C. Thauvin (erik@thauvin.net) * Copyright (c) 2022, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View file

@ -1,7 +1,7 @@
/* /*
* BitlyTest.kt * BitlyTest.kt
* *
* Copyright (c) 2020-2021, Erik C. Thauvin (erik@thauvin.net) * Copyright (c) 2022, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without