Compare commits
No commits in common. "f6b5a77eb58dedf2d7d743cd51a9bb8e11f93e3f" and "34b69a7d1f3570aa056285253376ed7a7bde03d8" have entirely different histories.
f6b5a77eb5
...
34b69a7d1f
29 changed files with 353 additions and 674 deletions
30
.github/workflows/gradle.yml
vendored
30
.github/workflows/gradle.yml
vendored
|
@ -1,6 +1,6 @@
|
||||||
name: gradle-ci
|
name: gradle-ci
|
||||||
|
|
||||||
on: [ push, pull_request, workflow_dispatch ]
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -15,14 +15,13 @@ jobs:
|
||||||
java-version: [ 11, 17, 19 ]
|
java-version: [ 11, 17, 19 ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up JDK ${{ matrix.java-version }}
|
- name: Set up JDK ${{ matrix.java-version }}
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
distribution: 'zulu'
|
|
||||||
java-version: ${{ matrix.java-version }}
|
java-version: ${{ matrix.java-version }}
|
||||||
|
|
||||||
- name: Grant execute permission for gradlew
|
- name: Grant execute permission for gradlew
|
||||||
|
@ -30,20 +29,33 @@ jobs:
|
||||||
|
|
||||||
- name: Cache SonarCloud packages
|
- name: Cache SonarCloud packages
|
||||||
if: matrix.java-version == env.SONAR_JDK
|
if: matrix.java-version == env.SONAR_JDK
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ~/.sonar/cache
|
path: ~/.sonar/cache
|
||||||
key: ${{ runner.os }}-sonar
|
key: ${{ runner.os }}-sonar
|
||||||
restore-keys: ${{ runner.os }}-sonar
|
restore-keys: ${{ runner.os }}-sonar
|
||||||
|
|
||||||
- name: Test with Gradle
|
- name: Cache Gradle packages
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
arguments: build check --stacktrace -PtestsBadgeApiKey=${{ secrets.TESTS_BADGE_API_KEY }}
|
path: |
|
||||||
|
~/.gradle/caches
|
||||||
|
~/.gradle/wrapper
|
||||||
|
key: ${{ runner.os }}-gradle-${{ matrix.java-version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-gradle-${{ matrix.java-version }}-
|
||||||
|
|
||||||
|
- name: Test with Gradle
|
||||||
|
run: ./gradlew build check --stacktrace -PtestsBadgeApiKey=${{ secrets.TESTS_BADGE_API_KEY }}
|
||||||
|
|
||||||
- name: SonarCloud
|
- name: SonarCloud
|
||||||
if: success() && matrix.java-version == env.SONAR_JDK
|
if: success() && matrix.java-version == env.SONAR_JDK
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
run: ./gradlew sonar --info
|
run: ./gradlew sonar
|
||||||
|
|
||||||
|
- name: Cleanup Gradle Cache
|
||||||
|
run: |
|
||||||
|
rm -f ~/.gradle/caches/modules-2/modules-2.lock
|
||||||
|
rm -f ~/.gradle/caches/modules-2/gc.properties
|
||||||
|
|
148
.gitignore
vendored
148
.gitignore
vendored
|
@ -1,73 +1,85 @@
|
||||||
### Gradle ###
|
!.vscode/extensions.json
|
||||||
.gradle
|
!.vscode/launch.json
|
||||||
build/
|
!.vscode/settings.json
|
||||||
deploy/
|
!.vscode/tasks.json
|
||||||
gradle.properties
|
|
||||||
|
|
||||||
### Kotlin/JVM ###
|
|
||||||
*.class
|
*.class
|
||||||
|
*.code-workspace
|
||||||
|
*.ctxt
|
||||||
|
*.iws
|
||||||
*.log
|
*.log
|
||||||
|
|
||||||
hs_err_pid*
|
|
||||||
replay_pid*
|
|
||||||
*.hprof
|
|
||||||
|
|
||||||
*.jar
|
|
||||||
*.war
|
|
||||||
*.nar
|
*.nar
|
||||||
*.ear
|
|
||||||
*.zip
|
|
||||||
*.tar.gz
|
|
||||||
*.rar
|
*.rar
|
||||||
|
*.sublime-*
|
||||||
|
*.tar.gz
|
||||||
### IntelliJ ###
|
*.zip
|
||||||
.idea/**/*
|
|
||||||
|
|
||||||
### Eclipse ###
|
|
||||||
.metadata
|
|
||||||
bin/
|
|
||||||
tmp/
|
|
||||||
*.tmp
|
|
||||||
*.bak
|
|
||||||
*.swp
|
|
||||||
*~.nib
|
|
||||||
.settings/
|
|
||||||
.loadpath
|
|
||||||
.recommenders
|
|
||||||
.classpath
|
|
||||||
|
|
||||||
.apt_generated/
|
|
||||||
.apt_generated_test/
|
|
||||||
.project
|
|
||||||
|
|
||||||
|
|
||||||
### Linux ###
|
|
||||||
*~
|
|
||||||
.fuse_hidden*
|
|
||||||
.Trash-*
|
|
||||||
.nfs*
|
|
||||||
|
|
||||||
|
|
||||||
### Windows ###
|
|
||||||
[Dd]esktop.ini
|
|
||||||
$RECYCLE.BIN/
|
|
||||||
*.lnk
|
|
||||||
|
|
||||||
|
|
||||||
### macOS ###
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
._*
|
.classpath
|
||||||
|
.gradle
|
||||||
# Icon must end with two \r
|
.history
|
||||||
Icon
|
.kobalt
|
||||||
|
.mtj.tmp/
|
||||||
|
.mvn/timing.properties
|
||||||
###########################
|
.mvn/wrapper/maven-wrapper.jar
|
||||||
|
.nb-gradle
|
||||||
# place overrides last, so they're not themselves overridden
|
.project
|
||||||
|
.scannerwork
|
||||||
!gradle/wrapper/gradle-wrapper.jar
|
.settings
|
||||||
!gradle/wrapper/gradle-wrapper.properties
|
.vscode/*
|
||||||
|
/**/.idea/$CACHE_FILE$
|
||||||
!.idea/copyright/**
|
/**/.idea/$PRODUCT_WORKSPACE_FILE$
|
||||||
|
/**/.idea/**/caches/build_file_checksums.ser
|
||||||
|
/**/.idea/**/contentModel.xml
|
||||||
|
/**/.idea/**/dataSources.ids
|
||||||
|
/**/.idea/**/dataSources.local.xml
|
||||||
|
/**/.idea/**/dataSources/
|
||||||
|
/**/.idea/**/dbnavigator.xml
|
||||||
|
/**/.idea/**/dictionaries
|
||||||
|
/**/.idea/**/dynamic.xml
|
||||||
|
/**/.idea/**/gradle.xml
|
||||||
|
/**/.idea/**/httpRequests
|
||||||
|
/**/.idea/**/libraries
|
||||||
|
/**/.idea/**/mongoSettings.xml
|
||||||
|
/**/.idea/**/replstate.xml
|
||||||
|
/**/.idea/**/shelf
|
||||||
|
/**/.idea/**/shelf/
|
||||||
|
/**/.idea/**/sqlDataSources.xml
|
||||||
|
/**/.idea/**/tasks.xml
|
||||||
|
/**/.idea/**/uiDesigner.xml
|
||||||
|
/**/.idea/**/usage.statistics.xml
|
||||||
|
/**/.idea/**/workspace.xml
|
||||||
|
/**/.idea/sonarlint*
|
||||||
|
/**/.idea_modules/
|
||||||
|
Thumbs.db
|
||||||
|
__pycache__
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
bin/
|
||||||
|
build/
|
||||||
|
cmake-build-*/
|
||||||
|
com_crashlytics_export_strings.xml
|
||||||
|
crashlytics-build.properties
|
||||||
|
crashlytics.properties
|
||||||
|
dependency-reduced-pom.xml
|
||||||
|
deploy/
|
||||||
|
dist/
|
||||||
|
ehthumbs.db
|
||||||
|
fabric.properties
|
||||||
|
gen/
|
||||||
|
gradle.properties
|
||||||
|
hs_err_pid*
|
||||||
|
kobaltBuild
|
||||||
|
kobaltw*-test
|
||||||
|
lib/kotlin*
|
||||||
|
libs/
|
||||||
|
local.properties
|
||||||
|
out/
|
||||||
|
pom.xml.asc
|
||||||
|
pom.xml.next
|
||||||
|
pom.xml.releaseBackup
|
||||||
|
pom.xml.tag
|
||||||
|
pom.xml.versionsBackup
|
||||||
|
proguard-project.txt
|
||||||
|
project.properties
|
||||||
|
release.properties
|
||||||
|
target/
|
||||||
|
test-output
|
||||||
|
venv
|
||||||
|
|
3
.idea/.gitignore
generated
vendored
Normal file
3
.idea/.gitignore
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
6
.idea/compiler.xml
generated
Normal file
6
.idea/compiler.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<bytecodeTargetLevel target="11" />
|
||||||
|
</component>
|
||||||
|
</project>
|
8
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
8
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="ADDITIONAL_TAGS" value="created" />
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
25
.idea/jarRepositories.xml
generated
Normal file
25
.idea/jarRepositories.xml
generated
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RemoteRepositoriesConfiguration">
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Maven Central repository" />
|
||||||
|
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="jboss.community" />
|
||||||
|
<option name="name" value="JBoss Community repository" />
|
||||||
|
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="MavenRepo" />
|
||||||
|
<option name="name" value="MavenRepo" />
|
||||||
|
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="maven" />
|
||||||
|
<option name="name" value="maven" />
|
||||||
|
<option name="url" value="https://oss.sonatype.org/content/repositories/snapshots" />
|
||||||
|
</remote-repository>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/kotlinc.xml
generated
Normal file
6
.idea/kotlinc.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="KotlinJpsPluginSettings">
|
||||||
|
<option name="version" value="1.8.0" />
|
||||||
|
</component>
|
||||||
|
</project>
|
8
.idea/misc.xml
generated
Normal file
8
.idea/misc.xml
generated
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="PDMPlugin">
|
||||||
|
<option name="skipTestSources" value="false" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="19" project-jdk-type="JavaSDK" />
|
||||||
|
</project>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -1,23 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2001-2023 Geert Bevin (gbevin[remove] at uwyn dot com)
|
|
||||||
* Copyright 2022-2023 Erik C. Thauvin (erik@thauvin.net)
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
buildsrc.conventions.base
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "net.thauvin.erik"
|
|
||||||
version = "1.4.0-SNAPSHOT"
|
|
|
@ -1,12 +0,0 @@
|
||||||
plugins {
|
|
||||||
`kotlin-dsl`
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation("com.github.ben-manes:gradle-versions-plugin:0.44.0")
|
|
||||||
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.22.0")
|
|
||||||
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.8.10")
|
|
||||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21")
|
|
||||||
implementation("org.jetbrains.kotlinx:kover-gradle-plugin:0.7.0")
|
|
||||||
implementation("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.5.0.2730")
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
rootProject.name = "buildSrc"
|
|
||||||
|
|
||||||
pluginManagement {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
gradlePluginPortal()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("UnstableApiUsage")
|
|
||||||
dependencyResolutionManagement {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
gradlePluginPortal()
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
package buildsrc.conventions
|
|
||||||
|
|
||||||
/** common config for all subprojects */
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
base
|
|
||||||
}
|
|
||||||
|
|
||||||
if (project != rootProject) {
|
|
||||||
project.version = rootProject.version
|
|
||||||
project.group = rootProject.group
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<AbstractArchiveTask>().configureEach {
|
|
||||||
// https://docs.gradle.org/current/userguide/working_with_files.html#sec:reproducible_archives
|
|
||||||
isPreserveFileTimestamps = false
|
|
||||||
isReproducibleFileOrder = true
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2001-2023 Geert Bevin (gbevin[remove] at uwyn dot com)
|
|
||||||
* Copyright 2022-2023 Erik C. Thauvin (erik@thauvin.net)
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package buildsrc.conventions
|
|
||||||
|
|
||||||
import buildsrc.utils.Rife2TestListener
|
|
||||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
|
||||||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
|
||||||
import org.sonarqube.gradle.SonarTask
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id("org.sonarqube")
|
|
||||||
id("io.gitlab.arturbosch.detekt")
|
|
||||||
id("org.jetbrains.kotlinx.kover")
|
|
||||||
}
|
|
||||||
|
|
||||||
sonarqube {
|
|
||||||
properties {
|
|
||||||
property("sonar.projectName", rootProject.name)
|
|
||||||
property("sonar.projectKey", "ethauvin_${rootProject.name}")
|
|
||||||
property("sonar.organization", "ethauvin-github")
|
|
||||||
property("sonar.host.url", "https://sonarcloud.io")
|
|
||||||
property("sonar.sourceEncoding", "UTF-8")
|
|
||||||
property("sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/kover/report.xml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<SonarTask>().configureEach {
|
|
||||||
dependsOn(tasks.matching { it.name == "koverXmlReport" })
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Test>().configureEach {
|
|
||||||
val testsBadgeApiKey = providers.gradleProperty("testsBadgeApiKey")
|
|
||||||
addTestListener(Rife2TestListener(testsBadgeApiKey))
|
|
||||||
testLogging {
|
|
||||||
exceptionFormat = TestExceptionFormat.FULL
|
|
||||||
events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,42 +0,0 @@
|
||||||
package buildsrc.conventions.lang
|
|
||||||
|
|
||||||
import buildsrc.utils.Rife2TestListener
|
|
||||||
import org.gradle.api.JavaVersion
|
|
||||||
import org.gradle.api.tasks.testing.Test
|
|
||||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
|
||||||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
|
||||||
import org.gradle.kotlin.dsl.withType
|
|
||||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
||||||
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
|
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
import org.sonarqube.gradle.SonarTask
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Common configuration for Kotlin/JVM projects
|
|
||||||
*
|
|
||||||
* (this can be removed after Kotlin Multiplatform migration)
|
|
||||||
*/
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id("buildsrc.conventions.base")
|
|
||||||
kotlin("jvm")
|
|
||||||
id("buildsrc.conventions.code-quality")
|
|
||||||
}
|
|
||||||
|
|
||||||
java {
|
|
||||||
withSourcesJar()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
jvmToolchain(11)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<KotlinCompile>().configureEach {
|
|
||||||
compilerOptions {
|
|
||||||
jvmTarget.set(JvmTarget.JVM_11)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Test>().configureEach {
|
|
||||||
useJUnitPlatform()
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
package buildsrc.conventions.lang
|
|
||||||
|
|
||||||
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Base configuration for all Kotlin/Multiplatform conventions.
|
|
||||||
*
|
|
||||||
* This plugin does not enable any Kotlin target. To enable a target in a subproject, prefer applying specific Kotlin
|
|
||||||
* target convention plugins.
|
|
||||||
*/
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id("buildsrc.conventions.base")
|
|
||||||
kotlin("multiplatform")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
jvmToolchain(11)
|
|
||||||
|
|
||||||
targets.configureEach {
|
|
||||||
compilations.configureEach {
|
|
||||||
kotlinOptions {
|
|
||||||
// nothin' yet
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// configure all Kotlin/JVM Tests to use JUnit
|
|
||||||
targets.withType<KotlinJvmTarget>().configureEach {
|
|
||||||
testRuns.configureEach {
|
|
||||||
executionTask.configure {
|
|
||||||
useJUnitPlatform()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets.configureEach {
|
|
||||||
languageSettings {
|
|
||||||
// languageVersion =
|
|
||||||
// apiVersion =
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
package buildsrc.conventions.lang
|
|
||||||
|
|
||||||
/** conventions for a Kotlin/JS subproject */
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id("buildsrc.conventions.lang.kotlin-multiplatform-base")
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
targets {
|
|
||||||
js(IR) {
|
|
||||||
browser()
|
|
||||||
nodejs()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
relocateKotlinJsStore()
|
|
|
@ -1,11 +0,0 @@
|
||||||
package buildsrc.conventions.lang
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id("buildsrc.conventions.lang.kotlin-multiplatform-base")
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
jvm {
|
|
||||||
withJava()
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,102 +0,0 @@
|
||||||
package buildsrc.conventions.lang
|
|
||||||
|
|
||||||
/** conventions for a Kotlin/Native subproject */
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id("buildsrc.conventions.lang.kotlin-multiplatform-base")
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
|
|
||||||
// Native targets all extend commonMain and commonTest.
|
|
||||||
//
|
|
||||||
// Some targets (ios, tvos, watchos) are shortcuts provided by the Kotlin DSL, that
|
|
||||||
// provide additional targets, except for 'simulators' which must be defined manually.
|
|
||||||
// https://kotlinlang.org/docs/multiplatform-share-on-platforms.html#use-target-shortcuts
|
|
||||||
//
|
|
||||||
// common/
|
|
||||||
// └── native/
|
|
||||||
// ├── linuxX64
|
|
||||||
// ├── mingwX64
|
|
||||||
// ├── macosX64
|
|
||||||
// ├── macosArm64
|
|
||||||
// ├── ios/ (shortcut)
|
|
||||||
// │ ├── iosArm64
|
|
||||||
// │ ├── iosX64
|
|
||||||
// │ └── iosSimulatorArm64
|
|
||||||
// ├── tvos/ (shortcut)
|
|
||||||
// │ ├── tvosArm64
|
|
||||||
// │ ├── tvosX64
|
|
||||||
// │ └── tvosSimulatorArm64Main
|
|
||||||
// └── watchos/ (shortcut)
|
|
||||||
// ├── watchosArm32
|
|
||||||
// ├── watchosArm64
|
|
||||||
// ├── watchosX64
|
|
||||||
// └── watchosSimulatorArm64Main
|
|
||||||
|
|
||||||
targets {
|
|
||||||
linuxX64()
|
|
||||||
|
|
||||||
mingwX64()
|
|
||||||
|
|
||||||
macosX64()
|
|
||||||
macosArm64()
|
|
||||||
|
|
||||||
// https://kotlinlang.org/docs/multiplatform-share-on-platforms.html#use-target-shortcuts
|
|
||||||
ios() // iosArm64, iosX64
|
|
||||||
watchos() // watchosArm32, watchosArm64, watchosX64
|
|
||||||
tvos() // tvosArm64, tvosX64
|
|
||||||
|
|
||||||
iosSimulatorArm64()
|
|
||||||
tvosSimulatorArm64()
|
|
||||||
watchosSimulatorArm64()
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("UNUSED_VARIABLE")
|
|
||||||
sourceSets {
|
|
||||||
val commonMain by getting {}
|
|
||||||
val commonTest by getting {}
|
|
||||||
|
|
||||||
val nativeMain by creating { dependsOn(commonMain) }
|
|
||||||
val nativeTest by creating { dependsOn(commonTest) }
|
|
||||||
|
|
||||||
// Linux
|
|
||||||
val linuxX64Main by getting { dependsOn(nativeMain) }
|
|
||||||
val linuxX64Test by getting { dependsOn(nativeTest) }
|
|
||||||
|
|
||||||
// Windows - MinGW
|
|
||||||
val mingwX64Main by getting { dependsOn(nativeMain) }
|
|
||||||
val mingwX64Test by getting { dependsOn(nativeTest) }
|
|
||||||
|
|
||||||
// Apple - macOS
|
|
||||||
val macosArm64Main by getting { dependsOn(nativeMain) }
|
|
||||||
val macosArm64Test by getting { dependsOn(nativeTest) }
|
|
||||||
|
|
||||||
val macosX64Main by getting { dependsOn(nativeMain) }
|
|
||||||
val macosX64Test by getting { dependsOn(nativeTest) }
|
|
||||||
|
|
||||||
// Apple - iOS
|
|
||||||
val iosMain by getting { dependsOn(nativeMain) }
|
|
||||||
val iosTest by getting { dependsOn(nativeTest) }
|
|
||||||
|
|
||||||
// val iosSimulatorArm64Main by getting { dependsOn(iosMain) }
|
|
||||||
// val iosSimulatorArm64Test by getting { dependsOn(iosTest) }
|
|
||||||
|
|
||||||
// // Apple - tvOS
|
|
||||||
// val tvosMain by getting { dependsOn(nativeMain) }
|
|
||||||
// val tvosTest by getting { dependsOn(nativeTest) }
|
|
||||||
//
|
|
||||||
// val tvosSimulatorArm64Main by getting { dependsOn(tvosMain) }
|
|
||||||
// val tvosSimulatorArm64Test by getting { dependsOn(tvosTest) }
|
|
||||||
//
|
|
||||||
// // Apple - watchOS
|
|
||||||
// val watchosMain by getting { dependsOn(nativeMain) }
|
|
||||||
// val watchosTest by getting { dependsOn(nativeTest) }
|
|
||||||
//
|
|
||||||
// val watchosSimulatorArm64Main by getting { dependsOn(watchosMain) }
|
|
||||||
// val watchosSimulatorArm64Test by getting { dependsOn(watchosTest) }
|
|
||||||
|
|
||||||
// val iosArm32Main by getting { dependsOn(desktopMain) }
|
|
||||||
// val iosArm32Test by getting { dependsOn(nativeTest) }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
package buildsrc.conventions.lang
|
|
||||||
|
|
||||||
import org.gradle.api.Project
|
|
||||||
import org.gradle.kotlin.dsl.configure
|
|
||||||
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension
|
|
||||||
|
|
||||||
/**
|
|
||||||
* `kotlin-js` and `kotlin-multiplatform` plugins adds a directory in the root-dir for the Yarn
|
|
||||||
* lockfile. That's a bit annoying. It's a little neater if it's in the Gradle dir, next to the
|
|
||||||
* version catalog.
|
|
||||||
*/
|
|
||||||
internal fun Project.relocateKotlinJsStore() {
|
|
||||||
afterEvaluate {
|
|
||||||
rootProject.extensions.configure<YarnRootExtension> {
|
|
||||||
lockFileDirectory = project.rootDir.resolve("gradle/kotlin-js-store")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,105 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2001-2023 Geert Bevin (gbevin[remove] at uwyn dot com)
|
|
||||||
* Copyright 2022-2023 Erik C. Thauvin (erik@thauvin.net)
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package buildsrc.conventions
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id("maven-publish")
|
|
||||||
id("signing")
|
|
||||||
id("org.jetbrains.dokka")
|
|
||||||
}
|
|
||||||
|
|
||||||
val gitHub = "ethauvin/${rootProject.name}"
|
|
||||||
val mavenUrl = "https://github.com/$gitHub"
|
|
||||||
val isSnapshotVersion = { project.version.toString().contains("SNAPSHOT") }
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
withType<MavenPublication>().configureEach {
|
|
||||||
pom {
|
|
||||||
name.set("UrlEncoder for Kotlin")
|
|
||||||
description.set(project.description)
|
|
||||||
url.set(mavenUrl)
|
|
||||||
licenses {
|
|
||||||
license {
|
|
||||||
name.set("The Apache License, Version 2.0")
|
|
||||||
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
developers {
|
|
||||||
developer {
|
|
||||||
id.set("gbevin")
|
|
||||||
name.set("Geert Bevin")
|
|
||||||
email.set("gbevin@uwyn.com")
|
|
||||||
url.set("https://github.com/gbevin")
|
|
||||||
}
|
|
||||||
developer {
|
|
||||||
id.set("ethauvin")
|
|
||||||
name.set("Erik C. Thauvin")
|
|
||||||
email.set("erik@thauvin.net")
|
|
||||||
url.set("https://erik.thauvin.net/")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
scm {
|
|
||||||
connection.set("scm:git://github.com/$gitHub.git")
|
|
||||||
developerConnection.set("scm:git@github.com:$gitHub.git")
|
|
||||||
url.set(mavenUrl)
|
|
||||||
}
|
|
||||||
issueManagement {
|
|
||||||
system.set("GitHub")
|
|
||||||
url.set("$mavenUrl/issues")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
maven(
|
|
||||||
if (isSnapshotVersion()) {
|
|
||||||
uri("https://oss.sonatype.org/content/repositories/snapshots/")
|
|
||||||
} else {
|
|
||||||
uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
name = "ossrh"
|
|
||||||
credentials(PasswordCredentials::class)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
signing {
|
|
||||||
useGpgCmd()
|
|
||||||
sign(publishing.publications)
|
|
||||||
|
|
||||||
setRequired({
|
|
||||||
!isSnapshotVersion() || gradle.taskGraph.hasTask("publish")
|
|
||||||
})
|
|
||||||
}
|
|
||||||
tasks.withType<Sign>().configureEach {
|
|
||||||
val signingRequiredPredicate = provider { signing.isRequired }
|
|
||||||
onlyIf { signingRequiredPredicate.get() }
|
|
||||||
}
|
|
||||||
|
|
||||||
// https://youtrack.jetbrains.com/issue/KT-46466
|
|
||||||
val signingTasks = tasks.withType<Sign>()
|
|
||||||
tasks.withType<AbstractPublishToMaven>().configureEach {
|
|
||||||
dependsOn(signingTasks)
|
|
||||||
}
|
|
||||||
|
|
||||||
val javadocJar by tasks.registering(Jar::class) {
|
|
||||||
dependsOn(tasks.dokkaJavadoc)
|
|
||||||
from(tasks.dokkaJavadoc)
|
|
||||||
archiveClassifier.set("javadoc")
|
|
||||||
}
|
|
|
@ -1,65 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2001-2023 Geert Bevin (gbevin[remove] at uwyn dot com)
|
|
||||||
* Copyright 2022-2023 Erik C. Thauvin (erik@thauvin.net)
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package buildsrc.utils
|
|
||||||
|
|
||||||
import org.gradle.api.provider.Provider
|
|
||||||
import org.gradle.api.tasks.testing.TestDescriptor
|
|
||||||
import org.gradle.api.tasks.testing.TestListener
|
|
||||||
import org.gradle.api.tasks.testing.TestResult
|
|
||||||
import java.net.URI
|
|
||||||
import java.net.http.HttpClient
|
|
||||||
import java.net.http.HttpRequest
|
|
||||||
import java.net.http.HttpResponse
|
|
||||||
|
|
||||||
class Rife2TestListener(
|
|
||||||
private val testBadgeApiKey: Provider<String>
|
|
||||||
) : TestListener {
|
|
||||||
override fun beforeTest(p0: TestDescriptor?) = Unit
|
|
||||||
override fun beforeSuite(p0: TestDescriptor?) = Unit
|
|
||||||
override fun afterTest(desc: TestDescriptor, result: TestResult) = Unit
|
|
||||||
override fun afterSuite(desc: TestDescriptor, result: TestResult) {
|
|
||||||
if (desc.parent == null) {
|
|
||||||
val passed = result.successfulTestCount
|
|
||||||
val failed = result.failedTestCount
|
|
||||||
val skipped = result.skippedTestCount
|
|
||||||
|
|
||||||
val apiKey = testBadgeApiKey.orNull
|
|
||||||
|
|
||||||
if (apiKey != null) {
|
|
||||||
println(apiKey)
|
|
||||||
val response: HttpResponse<String> = HttpClient.newHttpClient()
|
|
||||||
.send(
|
|
||||||
HttpRequest.newBuilder()
|
|
||||||
.uri(
|
|
||||||
URI(
|
|
||||||
"https://rife2.com/tests-badge/update/net.thauvin.erik/urlencoder?" +
|
|
||||||
"apiKey=$apiKey&" +
|
|
||||||
"passed=$passed&" +
|
|
||||||
"failed=$failed&" +
|
|
||||||
"skipped=$skipped"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.POST(HttpRequest.BodyPublishers.noBody())
|
|
||||||
.build(), HttpResponse.BodyHandlers.ofString()
|
|
||||||
)
|
|
||||||
println("RESPONSE: ${response.statusCode()}")
|
|
||||||
println(response.body())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
11
gradlew
vendored
11
gradlew
vendored
|
@ -85,6 +85,9 @@ done
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
|
||||||
|
@ -141,7 +144,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
|
@ -149,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
|
@ -194,10 +197,6 @@ if "$cygwin" || "$msys" ; then
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command;
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
|
|
|
@ -1,17 +1,42 @@
|
||||||
|
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||||
|
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||||
import org.jetbrains.dokka.gradle.DokkaTask
|
import org.jetbrains.dokka.gradle.DokkaTask
|
||||||
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
import java.net.URI
|
||||||
|
import java.net.http.HttpClient
|
||||||
|
import java.net.http.HttpRequest
|
||||||
|
import java.net.http.HttpResponse
|
||||||
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
buildsrc.conventions.lang.`kotlin-jvm`
|
|
||||||
buildsrc.conventions.publishing
|
|
||||||
id("application")
|
id("application")
|
||||||
id("com.github.ben-manes.versions")
|
id("com.github.ben-manes.versions") version "0.44.0"
|
||||||
|
id("io.gitlab.arturbosch.detekt") version "1.22.0"
|
||||||
|
id("java-library")
|
||||||
|
id("maven-publish")
|
||||||
|
id("org.jetbrains.dokka") version "1.7.20"
|
||||||
|
id("org.jetbrains.kotlin.jvm") version "1.8.0"
|
||||||
|
id("org.jetbrains.kotlinx.kover") version "0.6.1"
|
||||||
|
id("org.sonarqube") version "3.5.0.2730"
|
||||||
|
id("signing")
|
||||||
}
|
}
|
||||||
|
|
||||||
description = "A simple defensive library to encode/decode URL components"
|
description = "A simple defensive library to encode/decode URL components"
|
||||||
|
group = "net.thauvin.erik"
|
||||||
|
version = "1.3.1-SNAPSHOT"
|
||||||
|
|
||||||
val deployDir = project.layout.projectDirectory.dir("deploy")
|
|
||||||
val urlEncoderMainClass = "net.thauvin.erik.urlencoder.UrlEncoder"
|
val mavenName = "UrlEncoder"
|
||||||
|
val deployDir = "deploy"
|
||||||
|
val gitHub = "ethauvin/${rootProject.name}"
|
||||||
|
val mavenUrl = "https://github.com/$gitHub"
|
||||||
|
val publicationName = "mavenJava"
|
||||||
|
val myClassName = "$group.${rootProject.name}.$mavenName"
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// testImplementation("com.willowtreeapps.assertk:assertk-jvm:0.25")
|
// testImplementation("com.willowtreeapps.assertk:assertk-jvm:0.25")
|
||||||
|
@ -22,19 +47,42 @@ base {
|
||||||
archivesName.set(rootProject.name)
|
archivesName.set(rootProject.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
|
withSourcesJar()
|
||||||
|
}
|
||||||
|
|
||||||
application {
|
application {
|
||||||
mainClass.set(urlEncoderMainClass)
|
mainClass.set(myClassName)
|
||||||
|
}
|
||||||
|
|
||||||
|
sonarqube {
|
||||||
|
properties {
|
||||||
|
property("sonar.projectName", rootProject.name)
|
||||||
|
property("sonar.projectKey", "ethauvin_${rootProject.name}")
|
||||||
|
property("sonar.organization", "ethauvin-github")
|
||||||
|
property("sonar.host.url", "https://sonarcloud.io")
|
||||||
|
property("sonar.sourceEncoding", "UTF-8")
|
||||||
|
property("sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/kover/xml/report.xml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val javadocJar by tasks.creating(Jar::class) {
|
||||||
|
dependsOn(tasks.dokkaJavadoc)
|
||||||
|
from(tasks.dokkaJavadoc)
|
||||||
|
archiveClassifier.set("javadoc")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
attributes["Main-Class"] = urlEncoderMainClass
|
attributes["Main-Class"] = myClassName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val fatJar by registering(Jar::class) {
|
val fatJar = register<Jar>("fatJar") {
|
||||||
group = LifecycleBasePlugin.BUILD_GROUP
|
group = "build"
|
||||||
dependsOn.addAll(listOf("compileJava", "compileKotlin", "processResources"))
|
dependsOn.addAll(listOf("compileJava", "compileKotlin", "processResources"))
|
||||||
archiveClassifier.set("all")
|
archiveClassifier.set("all")
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
@ -49,10 +97,65 @@ tasks {
|
||||||
dependsOn(fatJar)
|
dependsOn(fatJar)
|
||||||
}
|
}
|
||||||
|
|
||||||
withType<GenerateMavenPom>().configureEach {
|
withType<KotlinCompile>().configureEach {
|
||||||
|
kotlinOptions.jvmTarget = java.targetCompatibility.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
test {
|
||||||
|
useJUnitPlatform()
|
||||||
|
addTestListener(object : TestListener {
|
||||||
|
override fun beforeTest(p0: TestDescriptor?) = Unit
|
||||||
|
override fun beforeSuite(p0: TestDescriptor?) = Unit
|
||||||
|
override fun afterTest(desc: TestDescriptor, result: TestResult) = Unit
|
||||||
|
override fun afterSuite(desc: TestDescriptor, result: TestResult) {
|
||||||
|
if (desc.parent == null) {
|
||||||
|
val passed = result.successfulTestCount
|
||||||
|
val failed = result.failedTestCount
|
||||||
|
val skipped = result.skippedTestCount
|
||||||
|
|
||||||
|
if (project.properties["testsBadgeApiKey"] != null) {
|
||||||
|
val apiKey = project.properties["testsBadgeApiKey"]
|
||||||
|
println(apiKey)
|
||||||
|
val response: HttpResponse<String> = HttpClient.newHttpClient()
|
||||||
|
.send(
|
||||||
|
HttpRequest.newBuilder()
|
||||||
|
.uri(
|
||||||
|
URI(
|
||||||
|
"https://rife2.com/tests-badge/update/net.thauvin.erik/urlencoder?" +
|
||||||
|
"apiKey=$apiKey&" +
|
||||||
|
"passed=$passed&" +
|
||||||
|
"failed=$failed&" +
|
||||||
|
"skipped=$skipped"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.POST(HttpRequest.BodyPublishers.noBody())
|
||||||
|
.build(), HttpResponse.BodyHandlers.ofString()
|
||||||
|
)
|
||||||
|
println("RESPONSE: ${response.statusCode()}")
|
||||||
|
println(response.body())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
withType<Test> {
|
||||||
|
testLogging {
|
||||||
|
exceptionFormat = TestExceptionFormat.FULL
|
||||||
|
events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
withType<GenerateMavenPom> {
|
||||||
destination = file("$projectDir/pom.xml")
|
destination = file("$projectDir/pom.xml")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clean {
|
||||||
|
doLast {
|
||||||
|
project.delete(fileTree(deployDir))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
withType<DokkaTask>().configureEach {
|
withType<DokkaTask>().configureEach {
|
||||||
dokkaSourceSets {
|
dokkaSourceSets {
|
||||||
named("main") {
|
named("main") {
|
||||||
|
@ -61,9 +164,7 @@ tasks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val copyToDeploy by registering(Sync::class) {
|
val copyToDeploy by registering(Copy::class) {
|
||||||
description = "Copies all needed files to the 'deploy' directory."
|
|
||||||
group = PublishingPlugin.PUBLISH_TASK_GROUP
|
|
||||||
from(configurations.runtimeClasspath) {
|
from(configurations.runtimeClasspath) {
|
||||||
exclude("annotations-*.jar")
|
exclude("annotations-*.jar")
|
||||||
}
|
}
|
||||||
|
@ -72,22 +173,73 @@ tasks {
|
||||||
}
|
}
|
||||||
|
|
||||||
register("deploy") {
|
register("deploy") {
|
||||||
description = "Copies all needed files to the 'deploy' directory."
|
description = "Copies all needed files to the $deployDir directory."
|
||||||
group = PublishingPlugin.PUBLISH_TASK_GROUP
|
group = PublishingPlugin.PUBLISH_TASK_GROUP
|
||||||
dependsOn(build, copyToDeploy)
|
dependsOn(clean, build, jar)
|
||||||
|
outputs.dir(deployDir)
|
||||||
|
inputs.files(copyToDeploy)
|
||||||
|
mustRunAfter(clean)
|
||||||
}
|
}
|
||||||
|
|
||||||
clean {
|
"sonar" {
|
||||||
delete(deployDir)
|
dependsOn(koverReport)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
create<MavenPublication>("mavenJava") {
|
create<MavenPublication>(publicationName) {
|
||||||
from(components["java"])
|
from(components["java"])
|
||||||
artifactId = rootProject.name
|
artifactId = rootProject.name
|
||||||
artifact(tasks.javadocJar)
|
artifact(javadocJar)
|
||||||
|
pom {
|
||||||
|
name.set("$mavenName for Kotlin")
|
||||||
|
description.set(project.description)
|
||||||
|
url.set(mavenUrl)
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name.set("The Apache License, Version 2.0")
|
||||||
|
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
id.set("gbevin")
|
||||||
|
name.set("Geert Bevin")
|
||||||
|
email.set("gbevin@uwyn.com")
|
||||||
|
url.set("https://github.com/gbevin")
|
||||||
|
}
|
||||||
|
developer {
|
||||||
|
id.set("ethauvin")
|
||||||
|
name.set("Erik C. Thauvin")
|
||||||
|
email.set("erik@thauvin.net")
|
||||||
|
url.set("https://erik.thauvin.net/")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scm {
|
||||||
|
connection.set("scm:git://github.com/$gitHub.git")
|
||||||
|
developerConnection.set("scm:git@github.com:$gitHub.git")
|
||||||
|
url.set(mavenUrl)
|
||||||
|
}
|
||||||
|
issueManagement {
|
||||||
|
system.set("GitHub")
|
||||||
|
url.set("$mavenUrl/issues")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
name = "ossrh"
|
||||||
|
url = if (project.version.toString().contains("SNAPSHOT"))
|
||||||
|
uri("https://oss.sonatype.org/content/repositories/snapshots/") else
|
||||||
|
uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
||||||
|
credentials(PasswordCredentials::class)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signing {
|
||||||
|
useGpgCmd()
|
||||||
|
sign(publishing.publications[publicationName])
|
||||||
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>net.thauvin.erik</groupId>
|
<groupId>net.thauvin.erik</groupId>
|
||||||
<artifactId>urlencoder</artifactId>
|
<artifactId>urlencoder</artifactId>
|
||||||
<version>1.4.0-SNAPSHOT</version>
|
<version>1.3.1-SNAPSHOT</version>
|
||||||
<name>UrlEncoder for Kotlin</name>
|
<name>UrlEncoder for Kotlin</name>
|
||||||
<description>A simple defensive library to encode/decode URL components</description>
|
<description>A simple defensive library to encode/decode URL components</description>
|
||||||
<url>https://github.com/ethauvin/urlencoder</url>
|
<url>https://github.com/ethauvin/urlencoder</url>
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jetbrains.kotlin</groupId>
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||||
<version>1.8.21</version>
|
<version>1.8.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
-----BEGIN PGP SIGNATURE-----
|
|
||||||
Version: BCPG v1.68
|
|
||||||
|
|
||||||
iQIzBAABCAAdFiEEOckYpvaxKUI3I6Pxd2cCpqLaMw4FAmO46y8ACgkQd2cCpqLa
|
|
||||||
Mw49qg//YPTr/FbXTVDB2KsPRRRMAMf3tQxvYknuMJsAIOTq9XfkmWM6XY+A1L6+
|
|
||||||
Up98MLrBMFKckrZ90bypTCZGhIi52yoE6StchFMJiuLGE+OwQIwPxaX0LNN3pLD6
|
|
||||||
BE5muGYZV762PeTkNU0oXNX+e0ReATnUHiriNvz9mZN/xDQLQ+C54wlu9wTKVC6l
|
|
||||||
beDezJsNYS4OhQJuJk4bm7w5umEocvbOydzSa/a95hQY9EfsQOUkc4jdGbDRGjKX
|
|
||||||
ladPDl8B+Y1+peJDkzcgL+A2T0mJ4bxouI32cGyQBXvawfcfz7ksifhoRDyESXrt
|
|
||||||
YoQMcVb9Bnv/k2r4jPSb92znTwCWY7joXrTE44C3wUk6cg8QoCEmjAdEfxwCM17f
|
|
||||||
pYIoejBGAMp3xYmzBJg4017e+Tg8hR2SrQHAF65GezEi/d9SOAevEp9aOPPSWOI1
|
|
||||||
0LgMcBAE9yxCF2r8EHpFyD2dHfaOI9kKsBfGyKn+8ksu75l6bCZRFJu4syYaNLZn
|
|
||||||
b9kHAHgmfikKMnHBZGr/SqYADnCLr/PwJFOhACDYtbhcXVm4PJT3l6Yep8xG1N84
|
|
||||||
+qTFA6CuOZjAklonbroHlkgn8ixhuC9ZNtKaIH6zvdG9SoaN4yMu7Itk6GtAAQy6
|
|
||||||
qCB+3oylZlKjh1mVo9X8iatL8rdgn8dsEwvC+ItsjsnxXtCPhX4=
|
|
||||||
=amWH
|
|
||||||
-----END PGP SIGNATURE-----
|
|
|
@ -1,25 +1,12 @@
|
||||||
|
/*
|
||||||
|
* This file was generated by the Gradle 'init' task.
|
||||||
|
*
|
||||||
|
* The settings file is used to specify which projects to include in your build.
|
||||||
|
*
|
||||||
|
* Detailed information about configuring a multi-project build in Gradle can be found
|
||||||
|
* in the user manual at https://docs.gradle.org/7.6/userguide/multi_project_builds.html
|
||||||
|
* This project uses @Incubating APIs which are subject to change.
|
||||||
|
*/
|
||||||
|
|
||||||
rootProject.name = "urlencoder"
|
rootProject.name = "urlencoder"
|
||||||
|
include("lib")
|
||||||
pluginManagement {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
gradlePluginPortal()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("UnstableApiUsage")
|
|
||||||
dependencyResolutionManagement {
|
|
||||||
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
maven("https://oss.sonatype.org/content/repositories/snapshots") {
|
|
||||||
name = "Sonatype Snapshots"
|
|
||||||
mavenContent { snapshotsOnly() }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
include(
|
|
||||||
":lib",
|
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue