From 458a58e996686b60202496acdac6c2afc2156ae8 Mon Sep 17 00:00:00 2001 From: David Wursteisen Date: Wed, 10 Mar 2021 11:00:39 +0100 Subject: [PATCH 1/5] [RELEASE] Prepare the usage of the minigdx gradle plugin --- Makefile | 13 +++ build.gradle.kts | 199 ++------------------------------------------ settings.gradle.kts | 1 + 3 files changed, 19 insertions(+), 194 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..eba2fcd --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +lint: + ./gradlew ktlintCheck + +lintfix: + ./gradlew ktlintFormat + +# Deploy the project into maven local +deploy: + ./gradlew publishToMavenLocal + +test: + ./gradlew allTest + diff --git a/build.gradle.kts b/build.gradle.kts index f8e4f00..1e86820 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,20 +1,5 @@ -import java.util.Date -import java.util.Properties - plugins { - kotlin("multiplatform") version "1.3.70" - id("maven-publish") - id("org.jlleitschuh.gradle.ktlint") version "9.2.1" - id("com.jfrog.bintray") version "1.8.5" - id("io.github.gradle-nexus.publish-plugin") version "1.0.0" - id("org.jetbrains.dokka") version "1.4.20" -} - -group = "com.github.minigdx" -version = project.properties["version"] ?: "1.0-SNAPSHOT" - -if (version == "unspecified") { - version = "1.0-SNAPSHOT" + id("com.github.minigdx.gradle.plugin.developer") version "1.0-SNAPSHOT" } repositories { @@ -22,182 +7,8 @@ repositories { jcenter() } -val javadocJar = tasks.register("javadocJar") { - dependsOn(tasks.getByName("dokkaHtml")) - archiveClassifier.set("javadoc") - from(project.buildDir.resolve("dokka")) -} - -publishing { - publications { - create("maven") { - from(components["kotlin"]) - artifact(javadocJar.get()) - } - } -} - -kotlin { - /* Targets configuration omitted. - * To find out how to configure the targets, please follow the link: - * https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targets */ - - js { - this.useCommonJs() - this.browser - this.nodejs - } - - jvm { - this.compilations.getByName("main").kotlinOptions.jvmTarget = "1.8" - this.compilations.getByName("test").kotlinOptions.jvmTarget = "1.8" - } - - mingwX64() { - binaries { - staticLib {} - sharedLib {} - } - } - linuxX64() { - binaries { - staticLib {} - sharedLib {} - } - } - ios() { - binaries { - staticLib {} - sharedLib {} - } - } - macosX64() { - binaries { - staticLib {} - sharedLib {} - } - } - - sourceSets { - val commonMain by getting { - dependencies { - implementation(kotlin("stdlib-common")) - } - } - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - } - } - - val jsMain by getting { - dependencies { - implementation(kotlin("stdlib-js")) - } - } - - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } - } - - val jvmMain by getting { - dependencies { - implementation(kotlin("stdlib-jdk8")) - } - } - - val jvmTest by getting { - dependencies { - implementation(kotlin("test-junit")) - - implementation("com.badlogicgames.gdx:gdx-backend-lwjgl:1.9.9") - implementation("com.badlogicgames.gdx:gdx-platform:1.9.9:natives-desktop") - - implementation("org.assertj:assertj-core:3.11.1") - } - } - - val macosX64Main by getting { - dependencies { } - } - } -} - -val properties = Properties() -if (project.file("local.properties").exists()) { - properties.load(project.file("local.properties").inputStream()) -} - -val bintrayUser = if (project.hasProperty("bintray_user")) { - project.property("bintray_user") as? String -} else { - System.getProperty("BINTRAY_USER") -} - -val bintrayKey = if (project.hasProperty("bintray_key")) { - project.property("bintray_key") as? String -} else { - System.getProperty("BINTRAY_KEY") -} - -nexusPublishing { - repositories { - sonatype() - } -} - -configure { - user = properties.getProperty("bintray.user") ?: bintrayUser - key = properties.getProperty("bintray.key") ?: bintrayKey - publish = true - if (findProperty("currentOs") == "macOS") { - setPublications("jvm", "js", "macosX64", "iosArm64", "iosX64", "metadata") - } else if (findProperty("currentOs") == "Windows") { - setPublications("mingwX64") - } else if (findProperty("currentOs") == "Linux") { - setPublications("maven", "linuxX64") - } - pkg(delegateClosureOf { - repo = "minigdx" - name = project.name - githubRepo = "dwursteisen/kotlin-math.git" - vcsUrl = "https://github.com/dwursteisen/kotlin-math.git" - description = project.description - setLabels("java") - setLicenses("Apache-2.0") - desc = description - version(closureOf { - this.name = project.version.toString() - released = Date().toString() - }) - }) -} - -tasks.named("bintrayUpload") { - dependsOn(":publishToMavenLocal") -} - -tasks.withType { - doFirst { - project.publishing.publications - .filterIsInstance() - .forEach { publication -> - val moduleFile = buildDir.resolve("publications/${publication.name}/module.json") - if (moduleFile.exists()) { - publication.artifact(object : - org.gradle.api.publish.maven.internal.artifact.FileBasedMavenArtifact(moduleFile) { - override fun getDefaultExtension() = "module" - }) - } - } - } -} - -project.afterEvaluate { - project.publishing.publications.forEach { - println("Available publication: ${it.name}") - } +dependencies { + this.jvmTestImplementation("com.badlogicgames.gdx:gdx-backend-lwjgl:1.9.9") + this.jvmTestImplementation("com.badlogicgames.gdx:gdx-platform:1.9.9:natives-desktop") + this.jvmTestImplementation("org.assertj:assertj-core:3.11.1") } diff --git a/settings.gradle.kts b/settings.gradle.kts index 171184d..7593763 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,5 +4,6 @@ pluginManagement { maven(url = "https://dl.bintray.com/kotlin/kotlin-eap") gradlePluginPortal() jcenter() + mavenLocal() } } From ba3c15473cf4e8c5d73cb1191001563be122d1d5 Mon Sep 17 00:00:00 2001 From: David Wursteisen Date: Wed, 10 Mar 2021 18:32:18 +0100 Subject: [PATCH 2/5] [RELEASE] Use of the minigdx mpp plugin --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 1e86820..7164296 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("com.github.minigdx.gradle.plugin.developer") version "1.0-SNAPSHOT" + id("com.github.minigdx.gradle.plugin.developer.mpp") version "1.0-SNAPSHOT" } repositories { From f69e3771c0283a4b44b85cbd01520f1d51f7f56f Mon Sep 17 00:00:00 2001 From: David Wursteisen Date: Fri, 12 Mar 2021 11:38:49 +0100 Subject: [PATCH 3/5] Use MiniGDX plugin 1.0.0-alpha1 --- build.gradle.kts | 3 +-- settings.gradle.kts | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 7164296..2f09ac4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,9 @@ plugins { - id("com.github.minigdx.gradle.plugin.developer.mpp") version "1.0-SNAPSHOT" + id("com.github.minigdx.gradle.plugin.developer.mpp") version "1.0.0-alpha1" } repositories { mavenCentral() - jcenter() } dependencies { diff --git a/settings.gradle.kts b/settings.gradle.kts index 7593763..64a4ee1 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,9 +1,7 @@ pluginManagement { repositories { - maven(url = "https://dl.bintray.com/kotlin/kotlin-eap") gradlePluginPortal() - jcenter() mavenLocal() } } From 782e6fede2606057743d93fdc1cca898efcc9168 Mon Sep 17 00:00:00 2001 From: David Wursteisen Date: Sat, 13 Mar 2021 14:05:30 +0100 Subject: [PATCH 4/5] Add project description for sonatype repository --- build.gradle.kts | 53 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2f09ac4..ecb5534 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("com.github.minigdx.gradle.plugin.developer.mpp") version "1.0.0-alpha1" + id("com.github.minigdx.gradle.plugin.developer.mpp") version "1.0.0-alpha2" } repositories { @@ -11,3 +11,54 @@ dependencies { this.jvmTestImplementation("com.badlogicgames.gdx:gdx-platform:1.9.9:natives-desktop") this.jvmTestImplementation("org.assertj:assertj-core:3.11.1") } + +minigdxDeveloper { + this.name.set("kotlin-math") + this.description.set("Set of Kotlin APIs to make graphics math easier to write.") + this.projectUrl.set("https://github.com/minigdx/kotlin-math") + this.licence { + name.set("Apache License 2.0") + url.set("https://github.com/minigdx/kotlin-math/blob/master/LICENSE") + } + developer { + name.set("David Wursteisen") + email.set("david.wursteisen+minigdx@gmail.com") + url.set("https://github.com/dwursteisen") + } + + developer { + name.set("Romain Guy") + email.set("romainguy@curious-creature.com") + url.set("https://github.com/romainguy") + } + + developer { + name.set("Denis Konoplev") + email.set("dekonoplyov@gmail.com") + } + + developer { + name.set("G0BL1N") + email.set("piraka282@gmail.com") + } + + developer { + name.set("shiraji") + email.set("isogai.shiraji@gmail.com") + } + + developer { + name.set("Kyle Nordbo") + email.set("knordbo@atlassian.com") + } + + developer { + name.set("Ryan Harter") + email.set("ryanjharter@gmail.com") + } + + developer { + name.set("Ravindra Kumar") + email.set("ravindrakumar8088@gmail.com") + } +} From 7e84f6435d4f0c76e3bab948429d1dee0ff0b1a0 Mon Sep 17 00:00:00 2001 From: David Wursteisen Date: Sat, 13 Mar 2021 14:09:03 +0100 Subject: [PATCH 5/5] Update workflow for release --- .github/workflows/publish-release.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index e03c516..2ac3e27 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -6,11 +6,7 @@ on: jobs: publish-release: - strategy: - matrix: - os: [macOS-latest, windows-latest, ubuntu-latest] - - runs-on: ${{matrix.os}} + runs-on: ubuntu-latest steps: - name: Checkout latest code @@ -25,7 +21,4 @@ jobs: ${{ runner.os }}-gradle- - name: Publish artifact - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: ./gradlew -Pversion="${{github.event.release.tag_name}}" -PcurrentOs=${{ runner.os }} -Pbintray_user=${{secrets.BINTRAY_USER}} -Pbintray_key=${{secrets.BINTRAY_KEY}} bintrayUpload + run: ./gradlew publishAllPublicationsToSonatypeStagingRepository -Pversion="${{github.event.release.tag_name}}" -Psigning.base64.secretKey="${{secrets.SIGNING_BASE_64_SECRET_KEY}}" -Psigning.password="${{secrets.SIGNING_PASSWORD}}" -Psonatype.username="${{secrets.SONATYPE_USERNAME}}" -Psonatype.password="${{secrets.SONATYPE_PASSWORD}}"