Merge branch 'master' of https://bitbucket.org/CrushedPixel/cpreplaymod
This commit is contained in:
46
build.gradle
46
build.gradle
@@ -33,8 +33,18 @@ minecraft {
|
|||||||
mappings = "snapshot_nodoc_20141130"
|
mappings = "snapshot_nodoc_20141130"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven { url "https://repo.johni0702.de/content/groups/public/" }
|
||||||
|
}
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
shade
|
||||||
|
compile.extendsFrom shade
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: 'lib', includes: ['*.jar'])
|
shade 'de.johni0702:replaystudio:0.0.1-SNAPSHOT'
|
||||||
|
shade fileTree(dir: 'libs', includes: ['*.jar'])
|
||||||
// you may put jars on which you depend on in ./libs
|
// you may put jars on which you depend on in ./libs
|
||||||
// or you may define them like so..
|
// or you may define them like so..
|
||||||
//compile "some.group:artifact:version:classifier"
|
//compile "some.group:artifact:version:classifier"
|
||||||
@@ -51,7 +61,23 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
//from { configurations.external.collect { it.isDirectory() ? it : zipTree(it) } }
|
dependsOn configurations.shade
|
||||||
|
def noticeDir = file("$buildDir/NOTICE")
|
||||||
|
doFirst {
|
||||||
|
noticeDir.deleteDir()
|
||||||
|
noticeDir.mkdirs()
|
||||||
|
configurations.shade.collect { it.isDirectory() ? fileTree(it) : zipTree(it) }.each {
|
||||||
|
it.matching { include '**/NOTICE*' }.each {
|
||||||
|
new File(noticeDir, 'NOTICE.txt') << it.getText('UTF-8') + '\n'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
from noticeDir
|
||||||
|
|
||||||
|
from (configurations.shade.collect { it.isDirectory() ? it : zipTree(it) }) {
|
||||||
|
exclude '**/NOTICE*'
|
||||||
|
}
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'FMLCorePlugin': 'eu.crushedpixel.replaymod.coremod.LoadingPlugin',
|
attributes 'FMLCorePlugin': 'eu.crushedpixel.replaymod.coremod.LoadingPlugin',
|
||||||
'FMLCorePluginContainsFMLMod': 'false'
|
'FMLCorePluginContainsFMLMod': 'false'
|
||||||
@@ -78,18 +104,4 @@ processResources
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defaultTasks 'build'
|
||||||
def shade() {
|
|
||||||
exec {
|
|
||||||
executable "./shade.sh"
|
|
||||||
args "./build/libs/replaymod-0.6.jar", "./libs", "replaymod-0.6.jar"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task doShade {
|
|
||||||
doLast {
|
|
||||||
shade()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultTasks 'build', 'doShade'
|
|
||||||
Binary file not shown.
17
shade.sh
17
shade.sh
@@ -1,17 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
JARPATH="$1"
|
|
||||||
LIBSPATH="$2"
|
|
||||||
FILENAME="$3"
|
|
||||||
|
|
||||||
TEMPDIR="./tempdir"
|
|
||||||
mkdir $TEMPDIR
|
|
||||||
|
|
||||||
unzip -o $LIBSPATH"/*.jar" -d $TEMPDIR
|
|
||||||
unzip -o $JARPATH -d $TEMPDIR
|
|
||||||
|
|
||||||
JARDIR=$(dirname "$JARPATH")
|
|
||||||
|
|
||||||
#Thanks to johni0702 for the following line of code <3
|
|
||||||
cd $TEMPDIR && ls | zip -r -@ "../$JARDIR/$FILENAME" && cd ..
|
|
||||||
|
|
||||||
rm -r $TEMPDIR
|
|
||||||
Reference in New Issue
Block a user