Fixed build env
This commit is contained in:
parent
58f1fd8253
commit
0a160541e2
3 changed files with 7 additions and 97 deletions
97
bclib.gradle
97
bclib.gradle
|
@ -23,62 +23,23 @@ repositories {
|
|||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
|
||||
minecraft {
|
||||
accessWidener = file("src/main/resources/bclib.accesswidener")
|
||||
loom {
|
||||
accessWidenerPath = file("src/main/resources/bclib.accesswidener")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||
mappings minecraft.officialMojangMappings()
|
||||
mappings loom.officialMojangMappings()
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||
|
||||
//useApi "vazkii.patchouli:Patchouli:1.16.4-${project.patchouli_version}"
|
||||
}
|
||||
|
||||
def useOptional(String dep) {
|
||||
dependencies.modRuntime (dep) {
|
||||
exclude group: 'net.fabricmc.fabric-api'
|
||||
exclude group: 'net.fabricmc'
|
||||
if (!dep.contains("me.shedaniel")) {
|
||||
exclude group: 'me.shedaniel.cloth'
|
||||
exclude group: 'me.shedaniel'
|
||||
}
|
||||
}
|
||||
dependencies.modCompileOnly (dep) {
|
||||
exclude group: 'net.fabricmc.fabric-api'
|
||||
exclude group: 'net.fabricmc'
|
||||
if (!dep.contains("me.shedaniel")) {
|
||||
exclude group: 'me.shedaniel.cloth'
|
||||
exclude group: 'me.shedaniel'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def useApi(String dep) {
|
||||
dependencies.modApi (dep) {
|
||||
exclude group: 'net.fabricmc.fabric-api'
|
||||
exclude group: 'net.fabricmc'
|
||||
if (!dep.contains("me.shedaniel")) {
|
||||
exclude group: 'me.shedaniel.cloth'
|
||||
exclude group: 'me.shedaniel'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
processResources {
|
||||
println "Version: ${project.mod_version}"
|
||||
inputs.property "version", project.mod_version
|
||||
// duplicatesStrategy = 'WARN'
|
||||
|
||||
// from(sourceSets.main.resources.srcDirs) {
|
||||
// include "fabric.mod.json"
|
||||
// expand "version": version
|
||||
// }
|
||||
|
||||
// from(sourceSets.main.resources.srcDirs) {
|
||||
// exclude "fabric.mod.json"
|
||||
// }
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": project.mod_version
|
||||
}
|
||||
|
@ -119,58 +80,6 @@ artifacts {
|
|||
archives javadocJar
|
||||
}
|
||||
|
||||
def env = System.getenv()
|
||||
|
||||
import org.kohsuke.github.GHReleaseBuilder
|
||||
import org.kohsuke.github.GitHub
|
||||
|
||||
task release(dependsOn: [remapJar, sourcesJar, javadocJar]) {
|
||||
onlyIf {
|
||||
env.GITHUB_TOKEN
|
||||
}
|
||||
|
||||
doLast {
|
||||
def github = GitHub.connectUsingOAuth(env.GITHUB_TOKEN as String)
|
||||
def repository = github.getRepository("paulevsGitch/BCLib")
|
||||
|
||||
def releaseBuilder = new GHReleaseBuilder(repository, version as String)
|
||||
releaseBuilder.name("${archivesBaseName}-${version}")
|
||||
releaseBuilder.body("A changelog can be found at https://github.com/paulevsGitch/BCLib/commits")
|
||||
releaseBuilder.commitish("main")
|
||||
|
||||
def ghRelease = releaseBuilder.create()
|
||||
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"), "application/java-archive");
|
||||
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}-sources.jar"), "application/java-archive");
|
||||
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}-javadoc.jar"), "application/java-archive");
|
||||
}
|
||||
}
|
||||
|
||||
// configure the maven publication
|
||||
publishing {
|
||||
publications {
|
||||
gpr(MavenPublication) {
|
||||
artifactId archivesBaseName
|
||||
artifact(remapJar) {
|
||||
builtBy remapJar
|
||||
}
|
||||
artifact(sourcesJar) {
|
||||
builtBy remapSourcesJar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// select the repositories you want to publish to
|
||||
repositories {
|
||||
maven {
|
||||
name = "GitHubPackages"
|
||||
url = uri("https://maven.pkg.github.com/paulevsgitch/bclib")
|
||||
credentials {
|
||||
username = env.GITHUB_USER
|
||||
password = env.GITHUB_TOKEN
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
dev {
|
||||
|
|
|
@ -7,8 +7,8 @@ loom_version=0.10-SNAPSHOT
|
|||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/versions.html
|
||||
minecraft_version= 1.18
|
||||
loader_version= 0.12.6
|
||||
fabric_version = 0.43.1+1.18
|
||||
loader_version= 0.12.8
|
||||
fabric_version = 0.44.0+1.18
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.0.0
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
],
|
||||
"modmenu": [ "ru.bclib.gui.modmenu.EntryPoint::entrypointObject" ]
|
||||
},
|
||||
"accessWidener" : "bclib.accesswidener",
|
||||
"mixins": [
|
||||
"bclib.mixins.common.json",
|
||||
"bclib.mixins.client.json"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue