Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitize build script #550

Open
wants to merge 1 commit into
base: 1.18
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ buildscript {
maven { url = 'https://maven.minecraftforge.net/' }
maven { url = 'https://maven.parchmentmc.org' }
maven { url 'https://plugins.gradle.org/m2/' }
jcenter()
mavenCentral()
}
dependencies {
Expand Down Expand Up @@ -34,7 +33,7 @@ repositories {
}
}

group= "mcjty.theoneprobe" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
group = "mcjty" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "theoneprobe"

if (System.getenv('BUILD_NUMBER') != null) {
Expand All @@ -44,7 +43,7 @@ if (System.getenv('BUILD_NUMBER') != null) {
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

minecraft {
mappings channel: 'official' , version: '1.18.2'
mappings channel: 'official' , version: project.minecraft_version
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

//runDir = "run"
Expand Down Expand Up @@ -89,7 +88,7 @@ jar {
"Specification-Vendor": "McJty",
"Specification-Version": "1",
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Version": project.version.toString(),
"Implementation-Vendor" :"McJty",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
}
Expand All @@ -116,33 +115,48 @@ jar {
//}

task apiJar(type: Jar) {
classifier = "api"
archiveClassifier.set("api")
from(sourceSets.main.output) {
include "mcjty/theoneprobe/api/**"
}
}

task sourceJar(type: Jar) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use java.withSourcesJar()?

archiveClassifier.set("sources")
from(sourceSets.main.allSource)
}

task deobfJar(type: Jar) {
archiveClassifier.set("deobf")
from(sourceSets.main.output)
}

artifacts {
archives apiJar
archives deobfJar
archives sourceJar
}

publishing {
publications.create('mavenJava', MavenPublication) {
from components.java
artifact jar
artifact apiJar
artifact sourceJar
artifact deobfJar

artifactId = project.archivesBaseName

pom {
name = 'RFToolsBase'
description = 'Base mod for all McJty tech mods'
name = project.modname
description = 'More immersive alternative for WAILA'
scm {
url = 'https:/McJtyMods/RFToolsBase'
connection = 'scm:git:[email protected]:McJtyMods/RFToolsBase.git'
developerConnection = 'scm:git:[email protected]:McJtyMods/RFToolsBase.git'
url = 'https:/McJtyMods/TheOneProbe'
connection = 'scm:git:[email protected]:McJtyMods/TheOneProbe.git'
developerConnection = 'scm:git:[email protected]:McJtyMods/TheOneProbe.git'
}
issueManagement {
system = 'github'
url = 'https:/McJtyMods/RFToolsBase/issues'
url = 'https:/McJtyMods/TheOneProbe/issues'
}
licenses {
license {
Expand All @@ -159,6 +173,7 @@ publishing {
}
}
}

repositories {
if (System.getenv('local_maven') != null) {
maven {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
modname=TheOneProbe
version=1.18-5.1.0
version=1.18.2-5.2.0
curse_type=beta
projectId=245211
github_project=McJtyMods/TheOneProbe
Expand Down