Skip to content

Commit

Permalink
Gradle 8.4, licence headers, GH Action (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaintNinja authored Oct 27, 2023
1 parent 5f7a8bd commit 440e415
Show file tree
Hide file tree
Showing 39 changed files with 383 additions and 368 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_names: "JarJarMetadata,JarJarFilesystems,JarJarSelector"
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.
96 changes: 44 additions & 52 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
import net.minecraftforge.gradleutils.PomUtils

plugins {
id 'net.minecraftforge.gradleutils'
id 'java-library'
id 'maven-publish'
id 'org.cadixdev.licenser' version '0.6.1'
}

group = 'net.minecraftforge'
version = gradleutils.getTagOffsetVersion()
println('Version: ' + version)
println "Version: $version"

subprojects { subproject ->
subprojects { Project subproject ->

subproject.apply plugin: 'java-library'
subproject.apply plugin: 'maven-publish'
subproject.apply {
plugin 'java-library'
plugin 'maven-publish'
plugin 'org.cadixdev.licenser'
}

subproject.group = 'net.minecraftforge'
subproject.version = rootProject.version
Expand All @@ -25,42 +31,39 @@ subprojects { subproject ->
}
}

repositories {
mavenCentral()
maven {
name 'Forge'
url 'https://maven.minecraftforge.net/'
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
withSourcesJar()
}

project.tasks.withType(JavaCompile).all {
JavaToolchainService service = getProject().getExtensions().getByType(JavaToolchainService.class);
Provider<JavaCompiler> compiler = service.compilerFor(s -> s.getLanguageVersion().set(JavaLanguageVersion.of(8)));

it.javaCompiler = compiler;
repositories {
mavenCentral()
maven gradleutils.forgeMaven
}

dependencies {
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: "${junitVersion}"
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: "${junitVersion}"
testImplementation libs.junit.api
testRuntimeOnly libs.junit.engine
}

test {
project.tasks.withType(JavaCompile).configureEach {
JavaToolchainService service = project.extensions.getByType(JavaToolchainService)
Provider<JavaCompiler> compiler = service.compilerFor(s -> s.languageVersion.set(JavaLanguageVersion.of(8)))

javaCompiler = compiler
}

tasks.named('test', Test).configure {
useJUnitPlatform()
}

processTestResources {
tasks.named('processTestResources', ProcessResources).configure {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

jar {
tasks.named('jar', Jar).configure {
manifest {
attributes([
'Maven-Artifact' : "${project.group}:${project.archivesBaseName}:${project.version}",
Expand All @@ -70,43 +73,32 @@ subprojects { subproject ->
"Implementation-Title" : project.name,
"Implementation-Version" : "${project.version}",
"Implementation-Vendor" : "Minecraft Forge",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Automatic-Module-Name" : project.name,
])
}
}

license {
header = file('../header.txt')
newLine = false
exclude '**/*.properties'
}

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

pom {
name = project.name
description = 'Jar in Jar Utilities including the required NIO FileSystems. SubSystem: ' + project.name
url = 'https://github.com/MinecraftForge/JarJar'

scm {
url = 'https://github.com/MinecraftForge/JarJar'
connection = 'scm:git:git://github.com/MinecraftForge/JarJar.git'
developerConnection = 'scm:git:[email protected]:MinecraftForge/JarJar.git'
}

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

licenses {
license {
name = 'LGPL 2.1'
url = 'https://github.com/MinecraftForge/JarJar/blob/main/LICENSE'
distribution = 'repo'
}
}
}
publications.register('mavenJava', MavenPublication) {
from components.java

pom {
name = project.name
description = 'Jar in Jar Utilities including the required NIO FileSystems. SubSystem: ' + project.name
url = 'https://github.com/MinecraftForge/JarJar'

PomUtils.setGitHubDetails(pom, 'JarJar')

license PomUtils.Licenses.LGPLv2_1
}
}

repositories {
maven gradleutils.getPublishingForgeMaven()
}
Expand All @@ -116,4 +108,4 @@ subprojects { subproject ->

changelog {
fromTag '0.3'
}
}
6 changes: 3 additions & 3 deletions filesystems/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ plugins {
}

dependencies {
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: "${junitVersion}"
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: "${junitVersion}"
}
testImplementation libs.junit.api
testRuntimeOnly libs.junit.engine
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) Forge Development LLC
* SPDX-License-Identifier: LGPL-2.1-only
*/
package net.minecraftforge.jarjar.nio.layfs;

import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) Forge Development LLC
* SPDX-License-Identifier: LGPL-2.1-only
*/
package net.minecraftforge.jarjar.nio.pathfs;

import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) Forge Development LLC
* SPDX-License-Identifier: LGPL-2.1-only
*/
package net.minecraftforge.jarjar.nio.pathfs;

import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) Forge Development LLC
* SPDX-License-Identifier: LGPL-2.1-only
*/
package net.minecraftforge.jarjar.nio;

import java.io.File;
Expand Down
Loading

0 comments on commit 440e415

Please sign in to comment.