Skip to content

Instantly share code, notes, and snippets.

@PhoenixVX
Created August 30, 2024 21:42
Show Gist options
  • Save PhoenixVX/6e60d3bf255d875825c259096bc649d6 to your computer and use it in GitHub Desktop.
Save PhoenixVX/6e60d3bf255d875825c259096bc649d6 to your computer and use it in GitHub Desktop.
build.gradle
plugins {
id 'java-library'
id 'maven-publish'
}
group = 'org.mcphackers'
archivesBaseName = 'launchwrapper'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
project.ext.asm_version = 9.6
dependencies {
implementation 'org.mcphackers.rdi:rdi:1.0'
implementation "org.ow2.asm:asm:${project.asm_version}"
implementation "org.ow2.asm:asm-tree:${project.asm_version}"
implementation 'org.json:json:20230311'
// I'll bring discord RPC support later, when I have an environment to compile natives
testRuntimeOnly('org.junit.platform:junit-platform-launcher:1.5.2')
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.0.0'
}
test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
events = ["passed", "failed", "skipped"]
showStandardStreams = true
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
version = '1.0-SNAPSHOT'
repositories {
flatDir {
dirs "libs"
}
maven {
url "https://mcphackers.github.io/libraries/"
}
maven {
url "https://libraries.minecraft.net/"
}
mavenCentral()
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar
archives sourcesJar
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = archivesBaseName
artifact jar
artifact sourcesJar
}
}
repositories {
mavenLocal()
def ENV = System.getenv()
if (ENV.MAVEN_URL) {
maven {
url ENV.MAVEN_URL
if (ENV.MAVEN_USERNAME) {
credentials {
username ENV.MAVEN_USERNAME
password ENV.MAVEN_PASSWORD
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment