Charged-Explosives/build.gradle
2022-10-15 23:50:15 -05:00

129 lines
3.7 KiB
Groovy

buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
}
dependencies {
classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.4.0"
}
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'com.matthewprenger.cursegradle'
group = 'com.oitsjustjose.charged_explosives' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "ChargedExplosives-${game_version}-${mod_version}"
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
mappings channel: 'official', version: "${game_version}"
runs {
client {
workingDirectory project.file('run')
property 'forge.logging.console.level', 'debug'
mods {
charged_explosives {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
property 'forge.logging.console.level', 'debug'
mods {
charged_explosives {
source sourceSets.main
}
}
}
}
}
repositories {
maven { url = "https://dvs1.progwml6.com/files/maven" }
}
dependencies {
minecraft "net.minecraftforge:forge:${game_version}-${forge_version}"
}
// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes([
"Specification-Title": "charged_explosives",
"Specification-Vendor": "oitsjustjose.com",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${mod_version}",
"Implementation-Vendor" :"oitsjustjose.com",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
// Example configuration to allow publishing using the maven-publish task
// we define a custom artifact that is sourced from the reobfJar output task
// and then declare that to be published
// Note you'll need to add a repository here
def reobfFile = file("$buildDir/reobfJar/output.jar")
def reobfArtifact = artifacts.add('default', reobfFile) {
type 'jar'
builtBy 'reobfJar'
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'Deobf'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'Sources'
from sourceSets.main.allSource
}
artifacts {
archives deobfJar
archives sourcesJar
}
// curseforge {
// apiKey = project.hasProperty("CURSEFORGE_API_KEY") ? project.CURSEFORGE_API_KEY : ""
// project {
// id = '238048'
// changelogType = 'markdown'
// changelog = file("./changelog.md")
// releaseType = 'release'
// addGameVersion "1.18.2"
// mainArtifact(jar) {
// displayName = "V-Tweaks ${game_version} ${mod_version}"
// }
// }
// }
publishing {
publications {
mavenJava(MavenPublication) {
artifact reobfArtifact
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}