Skip to content

Commit

Permalink
Gradle 8.4, GH Actions publishing (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaintNinja authored Oct 19, 2023
1 parent 059b727 commit e90dd9d
Show file tree
Hide file tree
Showing 43 changed files with 119 additions and 287 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish

on:
push:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:
uses: MinecraftForge/SharedActions/.github/workflows/gradle.yml@main
with:
java: 8
gradle_tasks: "publish"
artifact_name: "JarCompatibilityChecker"
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
PROMOTE_ARTIFACT_WEBHOOK: ${{ secrets.PROMOTE_ARTIFACT_WEBHOOK }}
PROMOTE_ARTIFACT_USERNAME: ${{ secrets.PROMOTE_ARTIFACT_USERNAME }}
PROMOTE_ARTIFACT_PASSWORD: ${{ secrets.PROMOTE_ARTIFACT_PASSWORD }}
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
104 changes: 0 additions & 104 deletions .teamcity/pom.xml

This file was deleted.

71 changes: 0 additions & 71 deletions .teamcity/settings.kts

This file was deleted.

File renamed without changes.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This means that there may be changes between the base JAR and concrete JAR which
```groovy
repositories {
maven {
name = 'MinecraftForge'
url = 'https://maven.minecraftforge.net/'
}
}
Expand All @@ -34,4 +35,4 @@ For JarCompatibilityChecker, binary compatibility means that all members, both p
Compatible means that a member still exists in the concrete JAR, its type or parameters has not been changed, and its visibility has not been lowered.
For the Java Language Specification, binary compatibility means a new version of a JAR does not break other binaries depending on previous versions of that JAR.
Binaries can normally only reference public and protected members of another JAR,
so this definition of binary compatibility is more in line with JarCompatibilityChecker's definition of API compatibility.
so this definition of binary compatibility is more in line with JarCompatibilityChecker's definition of API compatibility.
100 changes: 42 additions & 58 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.minecraftforge.gradleutils.PomUtils

plugins {
id 'java'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'org.cadixdev.licenser' version '0.6.1'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'net.minecraftforge.gradleutils' version '2.+'
}

group 'net.minecraftforge'

group = 'net.minecraftforge'
version = gradleutils.getTagOffsetVersion()
println('Version: ' + version)
java.toolchain.languageVersion = JavaLanguageVersion.of(8)

ext {
CHANGELOG_TAG = '0.1'
}
println "Version: $version"

license {
header project.file('LICENSE-header.txt')
include 'net/minecraftforge/jarcompatibilitychecker/**/*.java'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
withSourcesJar()
}

repositories {
mavenCentral()

maven {
url 'https://maven.minecraftforge.net/'
}
maven gradleutils.forgeMaven
}

dependencies {
Expand All @@ -39,7 +35,7 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
}

jar {
tasks.named('jar', Jar).configure {
from(project.rootDir) {
include 'LICENSE'
}
Expand All @@ -52,7 +48,7 @@ jar {
}
}

shadowJar {
tasks.named('shadowJar', ShadowJar).configure {
from(project.rootDir) {
include 'LICENSE'
}
Expand All @@ -63,56 +59,44 @@ shadowJar {
exclude 'META-INF/versions/9/module-info.class'
}

assemble.dependsOn shadowJar

java.withSourcesJar()
tasks.named('assemble').configure {
dependsOn 'shadowJar'
}

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}

changelog {
fromTag '0.1'
}

license {
header = file('LICENSE-header.txt')
newLine = false
include 'net/minecraftforge/jarcompatibilitychecker/**/*.java'
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java

pom {
name = 'JAR Compatibility Checker'
description = 'Reports API or binary incompatibilities between two JARs'
url = 'https://github.com/MinecraftForge/JarCompatibilityChecker'

scm {
url = 'https://github.com/MinecraftForge/JarCompatibilityChecker'
connection = 'scm:git:git://github.com/MinecraftForge/JarCompatibilityChecker.git'
developerConnection = 'scm:git:git@github.com:MinecraftForge/JarCompatibilityChecker.git'
}

issueManagement {
system = 'github'
url = 'https://github.com/MinecraftForge/JarCompatibilityChecker/issues'
}

licenses {
license {
name = 'LGPLv2.1'
url = 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt'
}
}

developers {
developer {
id = 'SizableShrimp'
name = 'SizableShrimp'
}
}
publications.register('mavenJava', MavenPublication) {
from components.java

pom {
name = 'JAR Compatibility Checker'
description = 'Reports API or binary incompatibilities between two JARs'
url = 'https://github.com/MinecraftForge/JarCompatibilityChecker'

PomUtils.setGitHubDetails(pom, 'JarCompatibilityChecker')

license PomUtils.Licenses.LGPLv2_1

developers {
developer PomUtils.Developers.SizableShrimp
}
}
}

repositories {
maven gradleutils.getPublishingForgeMaven()
}
}

changelog {
fromTag CHANGELOG_TAG
}
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
org.gradle.configureondemand=true
org.gradle.caching=true
org.gradle.parallel=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit e90dd9d

Please sign in to comment.