diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 784829f..69b1c2b 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -9,7 +9,7 @@ on: jobs: build: - uses: ome/action-workflows/.github/workflows/gradle_build.yml@v2.1 + uses: ome/action-workflows/.github/workflows/gradle_build.yml@main publish_snapshots: if: ${{ github.ref == 'refs/heads/master' && github.repository_owner == 'ome' }} needs: build diff --git a/build.gradle.kts b/build.gradle.kts index a8bf96d..7dc3167 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,22 +13,26 @@ kotlinDslPluginOptions { repositories { mavenCentral() - gradlePluginPortal() + maven { + setUrl("https://artifacts.openmicroscopy.org/artifactory/maven") + } } -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + +allprojects { + tasks.withType().configureEach { + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8.toString() + } + } } dependencies { implementation(kotlin("gradle-plugin")) implementation("org.jfrog.buildinfo:build-info-extractor-gradle:4.9.3") - implementation("org.ajoberstar:grgit:1.9.1") { - setForce(true) - } - implementation("org.ajoberstar:gradle-git:1.7.1") - implementation("org.ajoberstar:gradle-git-publish:0.3.3") + implementation("org.ajoberstar.grgit:grgit-core:5.3.0") + implementation("org.ajoberstar.grgit:grgit-gradle:5.3.0") + implementation("org.ajoberstar.git-publish:gradle-git-publish:4.2.2") } gradlePlugin { @@ -57,9 +61,5 @@ gradlePlugin { id = "org.openmicroscopy.plugin-publishing" implementationClass = "org.openmicroscopy.PluginPublishingPlugin" } - register("release-plugin") { - id = "org.openmicroscopy.release" - implementationClass = "org.openmicroscopy.ReleasePlugin" - } } } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 01e1cd2..72cede8 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -10,23 +10,19 @@ kotlinDslPluginOptions { experimentalWarning.set(false) } -configure { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - repositories { - jcenter() + maven { + setUrl("https://artifacts.openmicroscopy.org/artifactory/maven") + } + mavenCentral() } dependencies { implementation(kotlin("gradle-plugin")) implementation("org.jfrog.buildinfo:build-info-extractor-gradle:4.9.3") - implementation("org.ajoberstar:grgit:1.9.1") { - setForce(true) - } - implementation("org.ajoberstar:gradle-git:1.7.1") - implementation("org.ajoberstar:gradle-git-publish:0.3.3") + implementation("org.ajoberstar.grgit:grgit-core:5.3.0") + implementation("org.ajoberstar.grgit:grgit-gradle:5.3.0") + implementation("org.ajoberstar.git-publish:gradle-git-publish:4.2.2") } gradlePlugin { diff --git a/buildSrc/src/main/kotlin/org/openmicroscopy/PluginHelper.kt b/buildSrc/src/main/kotlin/org/openmicroscopy/PluginHelper.kt index e556004..ed13aac 100644 --- a/buildSrc/src/main/kotlin/org/openmicroscopy/PluginHelper.kt +++ b/buildSrc/src/main/kotlin/org/openmicroscopy/PluginHelper.kt @@ -1,6 +1,5 @@ package org.openmicroscopy -import com.google.common.base.CaseFormat import org.gradle.api.Action import org.gradle.api.Project import org.gradle.api.artifacts.Configuration @@ -98,7 +97,15 @@ class PluginHelper { } fun Project.camelCaseName(): String { - return CaseFormat.LOWER_HYPHEN.to(CaseFormat.LOWER_CAMEL, name) + val builder = StringBuilder() + for (v in name.split("-")) { + if (builder.toString() == "") { + builder.append(v) + } else { + builder.append(v.substring(0, 1).toUpperCase()).append(v.substring(1)) + } + } + return builder.toString() } } diff --git a/src/main/kotlin/org/openmicroscopy/ReleasePlugin.kt b/src/main/kotlin/org/openmicroscopy/ReleasePlugin.kt deleted file mode 100644 index 16e0ad5..0000000 --- a/src/main/kotlin/org/openmicroscopy/ReleasePlugin.kt +++ /dev/null @@ -1,62 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * Copyright (C) 2019 University of Dundee & Open Microscopy Environment. - * All rights reserved. - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * ------------------------------------------------------------------------------ - */ -package org.openmicroscopy - -import org.ajoberstar.gradle.git.base.GrgitPlugin -import org.ajoberstar.gradle.git.release.opinion.OpinionReleasePlugin -import org.ajoberstar.gradle.git.release.base.ReleasePluginExtension -import org.ajoberstar.gradle.git.release.base.ReleaseVersion -import org.ajoberstar.gradle.git.release.base.TagStrategy -import org.ajoberstar.gradle.git.release.opinion.Strategies -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.closureOf -import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.delegateClosureOf - -@Deprecated(message="Deprecated since 5.5.3") -class ReleasePlugin : Plugin { - override fun apply(project: Project): Unit = project.run { - applyGrgitPlugin() - configureReleasePluginExtension() - } - - private - fun Project.applyGrgitPlugin() { - apply() - apply() - } - - private - fun Project.configureReleasePluginExtension() { - configure { - versionStrategy(Strategies.getFINAL()) - defaultVersionStrategy = Strategies.getSNAPSHOT() - tagStrategy(delegateClosureOf { - generateMessage = closureOf { - "Version ${project.version}" - } - }) - } - } -}