12 Commits

Author SHA1 Message Date
55efba22bd v0.10.0 2023-02-07 06:36:41 -05:00
2cb2d8fe89 v0.10.0 2023-02-07 06:34:30 -05:00
b3219afb24 v0.10.0 2023-02-07 06:31:43 -05:00
ac7ec227b0 Gradle Plugin Portal 2023-02-07 06:31:23 -05:00
0ed243e9ae Publish sources JAR and ensure new lines. 2023-02-07 05:57:45 -05:00
34648bdc8c Begin work on 0.10.0-SNAPSHOT 2023-02-05 21:33:03 -08:00
e1e42df67e v0.9.0 2023-02-05 21:32:40 -08:00
dc1ebe09b7 Upgrade Kotlin to 1.8.10 2023-02-05 21:30:50 -08:00
1cd36b5529 Start work on 0.9.0 2023-02-03 13:08:14 -08:00
a06687507c v0.8.0 2023-02-03 13:07:49 -08:00
5d4152d6df Support CONCRETE_BUILD_NUMBER for build number in version. 2023-02-02 20:33:32 -08:00
4c7dea2296 Start on v0.8.0-SNAPSHOT 2023-01-27 22:43:23 -08:00
6 changed files with 82 additions and 12 deletions

20
.github/workflows/portal.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: Gradle Plugin Portal
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Publish with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: "publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_PLUGIN_PUBLISHING_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PLUGIN_PUBLISHING_SECRET }}"

View File

@ -4,7 +4,7 @@ on:
branches:
- main
jobs:
build:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository

View File

@ -1,13 +1,16 @@
@file:Suppress("UnstableApiUsage")
plugins {
`kotlin-dsl`
kotlin("plugin.serialization") version "1.7.10"
id("maven-publish")
id("java-gradle-plugin")
`maven-publish`
`java-gradle-plugin`
id("com.gradle.plugin-publish") version "1.1.0"
}
group = "gay.pizza.foundation"
version = "0.7.0"
version = "0.10.0"
repositories {
mavenCentral()
@ -15,8 +18,8 @@ repositories {
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10")
implementation("org.jetbrains.kotlin:kotlin-serialization:1.7.10")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10")
implementation("org.jetbrains.kotlin:kotlin-serialization:1.8.10")
implementation("gradle.plugin.com.github.johnrengelman:shadow:7.1.2")
implementation("com.google.code.gson:gson:2.10.1")
@ -25,29 +28,56 @@ dependencies {
}
gradlePlugin {
website.set("https://github.com/GayPizzaSpecifications/concrete")
vcsUrl.set("https://github.com/GayPizzaSpecifications/concrete")
plugins {
create("concrete-root") {
id = "gay.pizza.foundation.concrete-root"
implementationClass = "gay.pizza.foundation.concrete.ConcreteRootPlugin"
displayName = "Concrete Root"
description = "Concrete project root."
}
create("concrete-base") {
id = "gay.pizza.foundation.concrete-base"
implementationClass = "gay.pizza.foundation.concrete.ConcreteBasePlugin"
displayName = "Concrete Base"
description = "Concrete project base."
}
create("concrete-library") {
id = "gay.pizza.foundation.concrete-library"
implementationClass = "gay.pizza.foundation.concrete.ConcreteLibraryPlugin"
displayName = "Concrete Library"
description = "Concrete project library."
}
create("concrete-plugin") {
id = "gay.pizza.foundation.concrete-plugin"
implementationClass = "gay.pizza.foundation.concrete.ConcretePluginPlugin"
displayName = "Concrete Library"
description = "Concrete project plugin."
}
forEach { declaration ->
declaration.tags.set(listOf("foundation-concrete", "minecraft-bukkit"))
}
}
}
val gradlePublishingKey: String? = System.getenv("GRADLE_PLUGIN_PUBLISHING_KEY")
val gradlePublishingSecret: String? = System.getenv("GRADLE_PLUGIN_PUBLISHING_SECRET")
if (gradlePublishingKey != null && gradlePublishingSecret != null) {
project.setProperty("gradle.publish.key", gradlePublishingKey.toString())
project.setProperty("gradle.publish.secret", gradlePublishingSecret.toString())
}
java {
val version = JavaVersion.toVersion("17")
sourceCompatibility = version
@ -101,3 +131,7 @@ publishing {
tasks.withType<Wrapper> {
gradleVersion = "7.6"
}
java {
withSourcesJar()
}

View File

@ -12,6 +12,8 @@ open class ConcreteBasePlugin : Plugin<Project> {
override fun apply(project: Project) {
val versionWithBuild = if (System.getenv("CI_PIPELINE_IID") != null) {
project.rootProject.version.toString() + ".${System.getenv("CI_PIPELINE_IID")}"
} else if (System.getenv("CONCRETE_BUILD_NUMBER") != null) {
project.rootProject.version.toString() + ".${System.getenv("CONCRETE_BUILD_NUMBER")}"
} else {
"DEV"
}

View File

@ -11,12 +11,16 @@ class ConcretePluginPlugin : ConcreteBaseBukkitPlugin() {
project.plugins.apply("com.github.johnrengelman.shadow")
project.tasks.find<ProcessResources>("processResources")!!.apply {
val props = mapOf("version" to project.version.toString())
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("plugin.yml") {
expand(props)
// During IDEA project import, if this code is active, it will print warnings.
// This will make the VERSION field unexpanded if you run using the IntelliJ build system.
if (!project.properties.containsKey("idea.gradle.do.not.build.tasks")) {
project.tasks.find<ProcessResources>("processResources")!!.apply {
val props = mapOf("version" to project.version.toString())
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("plugin.yml") {
expand(props)
}
}
}

10
tools/ensure-new-lines.sh Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -e
git ls-files -z | while IFS= read -rd '' f
do
if file --mime-encoding "$f" | grep -qv binary
then
tail -c1 < "$f" | read -r _ || echo >> "$f"
fi
done