Skip to content

Commit

Permalink
Move markers to a data file, so that they are not exposed to anyone l…
Browse files Browse the repository at this point in the history
…inking against us.
  • Loading branch information
LexManos committed Oct 19, 2023
1 parent 1967e25 commit f5da113
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 438 deletions.
131 changes: 12 additions & 119 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,9 @@ repositories {

license {
header = file('LICENSE-header.txt')
include 'net/minecraftforge/mergetool/**/*.java'
newLine = false
}

sourceSets {
cpwFML
forgeFML
forgeAPI
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
Expand All @@ -40,57 +33,24 @@ java {
}

tasks.named('jar', Jar).configure {
from(configurations.markers.collect { zipTree(it) } ) {
into 'markers'
include '**/*.class'
rename { it.replace('.class', '.marker') }
}
manifest {
attributes('Main-Class': 'net.minecraftforge.mergetool.ConsoleMerger')
attributes('Implementation-Version': project.version)
}
from sourceSets.cpwFML.output
from sourceSets.forgeFML.output
from sourceSets.forgeAPI.output
}

tasks.named('shadowJar', ShadowJar).configure {
archiveClassifier = 'fatjar'
}

tasks.named('sourcesJar', Jar).configure {
from sourceSets.cpwFML.allSource
from sourceSets.forgeFML.allSource
from sourceSets.forgeAPI.allSource
}

tasks.register('cpwFML', Jar) {
archiveClassifier = 'cpw'
from sourceSets.cpwFML.output
}

tasks.register('cpwFMLSources', Jar) {
from sourceSets.cpwFML.allSource
archiveClassifier = 'sources'
archiveBaseName = 'mergetool-cpw'
}

tasks.register('forgeFML', Jar) {
archiveClassifier = 'forge'
from sourceSets.forgeFML.output
}

tasks.register('forgeFMLSources', Jar) {
from sourceSets.forgeFML.allSource
archiveClassifier = 'sources'
archiveBaseName = 'mergetool-fml'
}

tasks.register('forgeAPI', Jar) {
manifest.attributes('Automatic-Module-Name': 'net.minecraftforge.mergetool.api')
archiveClassifier = 'api'
from sourceSets.forgeAPI.output
}

tasks.register('forgeAPISources', Jar) {
from sourceSets.forgeAPI.allSource
archiveClassifier = 'sources'
archiveBaseName = 'mergetool-api'
configurations {
markers
implementation.extendsFrom(markers)
}

dependencies {
Expand All @@ -99,10 +59,10 @@ dependencies {
implementation 'org.ow2.asm:asm-util:9.5'
implementation 'net.sf.jopt-simple:jopt-simple:5.0.4'
implementation 'net.minecraftforge:srgutils:0.4.15'

implementation sourceSets.cpwFML.output
implementation sourceSets.forgeFML.output
implementation sourceSets.forgeAPI.output
markers 'net.minecraftforge:mergetool-cpw:1.0'
markers 'net.minecraftforge:mergetool-fml:1.0'
markers 'net.minecraftforge:mergetool-api:1.0'
}

artifacts {
Expand Down Expand Up @@ -130,73 +90,6 @@ publishing {
}
}

publications.register('mavenJavaApi', MavenPublication) {
artifact source: forgeAPI, classifier: ''
artifact forgeAPISources

artifactId = 'mergetool-api'
version = '1.0'

pom {
name = 'MergeTool-API'
description = 'API Markers for Merging Two jars together. See https://github.com/MinecraftForge/MergeTool'
url = 'https://github.com/MinecraftForge/MergeTool'

PomUtils.setGitHubDetails(pom, 'MergeTool')

license PomUtils.Licenses.LGPLv2_1

developers {
developer PomUtils.Developers.LexManos
}
}
}

publications.register('mavenJavaCpw', MavenPublication) {
artifact source: cpwFML, classifier: ''
artifact cpwFMLSources

artifactId = 'mergetool-cpw'
version = '1.0'

pom {
name = 'MergeTool-cpw'
description = 'API Markers for Merging Two jars together. See https://github.com/MinecraftForge/MergeTool'
url = 'https://github.com/MinecraftForge/MergeTool'

PomUtils.setGitHubDetails(pom, 'MergeTool')

license PomUtils.Licenses.LGPLv2_1

developers {
developer PomUtils.Developers.cpw
}
}
}

publications.register('mavenJavaFML', MavenPublication) {
artifact source: forgeFML, classifier: ''
artifact forgeFMLSources

artifactId = 'mergetool-fml'
version = '1.0'

pom {
name = 'MergeTool-fml'
description = 'API Markers for Merging Two jars together. See https://github.com/MinecraftForge/MergeTool'
url = 'https://github.com/MinecraftForge/MergeTool'

PomUtils.setGitHubDetails(pom, 'MergeTool')

license PomUtils.Licenses.LGPLv2_1

developers {
developer PomUtils.Developers.cpw
}
}
}


repositories {
maven gradleutils.getPublishingForgeMaven()
}
Expand Down
33 changes: 0 additions & 33 deletions src/cpwFML/java/cpw/mods/fml/relauncher/Side.java

This file was deleted.

26 changes: 0 additions & 26 deletions src/cpwFML/java/cpw/mods/fml/relauncher/SideOnly.java

This file was deleted.

62 changes: 0 additions & 62 deletions src/forgeAPI/java/net/minecraftforge/api/distmarker/Dist.java

This file was deleted.

58 changes: 0 additions & 58 deletions src/forgeAPI/java/net/minecraftforge/api/distmarker/OnlyIn.java

This file was deleted.

34 changes: 0 additions & 34 deletions src/forgeAPI/java/net/minecraftforge/api/distmarker/OnlyIns.java

This file was deleted.

Loading

0 comments on commit f5da113

Please sign in to comment.