Advertisement
Guest User

Untitled

a guest
Jul 6th, 2018
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 7.15 KB | None | 0 0
  1. buildscript {
  2.     repositories {
  3.         jcenter()
  4.         maven { url "http://files.minecraftforge.net/maven" }
  5.         maven {
  6.             url "https://plugins.gradle.org/m2/"
  7.         }
  8.     }
  9.     dependencies {
  10.         classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
  11.         classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.0.10"
  12.     }
  13. }
  14. apply plugin: 'net.minecraftforge.gradle.forge'
  15. // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
  16. apply plugin: 'com.matthewprenger.cursegradle'
  17. apply plugin: 'java'
  18.  
  19. version = "0.1.6"
  20. group = "io.github.lukas2005.lda" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  21. archivesBaseName = "lda"
  22.  
  23. def jxbrowser_version = "6.21"
  24.  
  25. def core_plugin = "io.github.lukas2005.DeviceModApps.coremod.CoreModMain"
  26.  
  27. sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
  28. compileJava {
  29.     sourceCompatibility = targetCompatibility = '1.8'
  30.     options.encoding = 'UTF-8'
  31. }
  32.  
  33. repositories {
  34.     maven { url 'https://jitpack.io' }
  35.     maven { url 'http://repo.jenkins-ci.org/releases' }
  36.     maven { url = "https://mrcrayfish.com/maven" }
  37. }
  38.  
  39. minecraft {
  40.     version = "1.12.2-14.23.1.2555"
  41.     runDir = "run"
  42.    
  43.     // the mappings can be changed at any time, and must be in the following format.
  44.     // snapshot_YYYYMMDD   snapshot are built nightly.
  45.     // stable_#            stables are built at the discretion of the MCP team.
  46.     // Use non-default mappings at your own risk. they may not always work.
  47.     // simply re-run your setup task after changing the mappings to update your workspace.
  48.     mappings = "snapshot_20171003"
  49.     // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  50.  
  51.     clientJvmArgs = ["-Dfml.coreMods.load=$core_plugin"]
  52.     serverJvmArgs = ["-Dfml.coreMods.load=$core_plugin"]
  53. }
  54.  
  55. // Add "embedded" configuration
  56. configurations {
  57.     embed
  58.     compile.extendsFrom(embed)
  59.     embedCore
  60.     compile.extendsFrom(embedCore)
  61.     jarInJarEmbed
  62.     compile.extendsFrom(jarInJarEmbed)
  63. }
  64.  
  65. dependencies {
  66.     // you may put jars on which you depend on in ./libs
  67.     // or you may define them like so..
  68.     //compile "some.group:artifact:version:classifier"
  69.     //compile "some.group:artifact:version"
  70.  
  71.     jarInJarEmbed files("lib/mp3spi1.9.5.jar")
  72.     jarInJarEmbed files("lib/vorbisspi1.0.3.jar")
  73.     embed files("lib/jl1.0.1.jar")
  74.     embed files("lib/tritonus_share.jar")
  75.     embed files("lib/jorbis-0.0.15.jar")
  76.     embed files("lib/jogg-0.0.7.jar")
  77.    
  78.     embed files("lib/jxbrowser/licence.jar")
  79.     embed files("lib/jxbrowser/lib/jxbrowser-"+jxbrowser_version+".jar")
  80.  
  81.     compile files("lib/jxbrowser/lib/jxbrowser-linux64-"+jxbrowser_version+".jar")
  82.     compile files("lib/jxbrowser/lib/jxbrowser-mac-"+jxbrowser_version+".jar")
  83.     compile files("lib/jxbrowser/lib/jxbrowser-win32-"+jxbrowser_version+".jar")
  84.    
  85.     embedCore files("lib/javassist.jar")
  86.  
  87.     compile 'com.mrcrayfish:device-api:0.4.0-1.12.2'
  88.  
  89.     embed 'org.apache.tika:tika-core:1.18'
  90.  
  91.     // https://mvnrepository.com/artifact/org.kohsuke/github-api
  92.     embed ('org.kohsuke:github-api:1.90') {
  93.         exclude group: 'commons-io'
  94.     }
  95.  
  96.     embed ('com.google.apis:google-api-services-youtube:v3-rev186-1.23.0') {
  97.         exclude group: 'com.google.guava'
  98.     }
  99.  
  100.     //compile 'com.github.lukas2005:Device-Essentials:21f9e02c18a231d85e69bcfa6c1415682af07927'
  101.  
  102.     // real examples
  103.     //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
  104.     //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
  105.  
  106.     // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
  107.     //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  108.  
  109.     // the deobf configurations:  'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
  110.     // except that these dependencies get remapped to your current MCP mappings
  111.     //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  112.     //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  113.  
  114.     // for more info...
  115.     // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
  116.     // http://www.gradle.org/docs/current/userguide/dependency_management.html
  117.  
  118. }
  119.  
  120. task coreJar(type: Jar) {
  121.     from(sourceSets.main.output) {
  122.         include 'io/github/lukas2005/DeviceModApps/coremod/**'
  123.     }
  124.     manifest.mainAttributes(
  125.             "Implementation-Title": project.name + "-corePlugin",
  126.             "Implementation-Version": "${project.version}",
  127.             "Built-On": "${minecraft.version}-${minecraft.forgeVersion}",
  128.             "FMLCorePlugin": "$core_plugin"
  129.     )
  130.  
  131.     from configurations.embedCore.collect {
  132.         exclude '.classpath'
  133.         exclude '.project'
  134.         exclude 'META-INF/LICENSE.txt'
  135.         exclude 'META-INF/NOTICE.txt'
  136.         exclude 'META-INF/LICENSE'
  137.         exclude 'META-INF/NOTICE'
  138.         exclude 'META-INF/DEPENDENCIES'
  139.         it.isDirectory() ? it : zipTree(it)
  140.     }
  141.  
  142.     classifier 'corePlugin'
  143.     group = 'build'
  144. }
  145.  
  146. reobf {
  147.     coreJar {
  148.         mappingType = 'SEARGE'
  149.     }
  150. }
  151.  
  152. task signCoreJar(type: SignJar) {
  153.     onlyIf {
  154.         project.hasProperty('sign_keyStore')
  155.     }
  156.     keyPass = findProperty('sign_keyPass')
  157.     keyStore = findProperty('sign_keyStore')
  158.     storePass = findProperty('sign_storePass')
  159.     alias = findProperty('sign_alias')
  160.  
  161.     inputFile = coreJar.archivePath
  162.     outputFile = coreJar.archivePath
  163.     dependsOn reobfCoreJar
  164. }
  165.  
  166. jar {
  167.     dependsOn signCoreJar
  168.  
  169.     from(coreJar.archivePath.absolutePath) {
  170.         include '*'
  171.     }
  172.     exclude 'io/github/lukas2005/DeviceModApps/coremod/**'
  173.     def DEPS = coreJar.archivePath.name
  174.  
  175.     configurations.jarInJarEmbed.each {
  176.         dep -> DEPS += ' ' + dep.getName()
  177.             from(dep.getAbsolutePath()) {
  178.                 include '*'
  179.             }
  180.     }
  181.  
  182.     manifest.mainAttributes(
  183.             "Implementation-Title": project.name,
  184.             "Implementation-Version": "${project.version}",
  185.             "Built-On": "${minecraft.version}-${minecraft.forgeVersion}",
  186.             "Maven-Artifact":"${project.group}:${archivesBaseName}:${project.version}",
  187.             "FMLAT": "${project.name}_at.cfg",
  188.             "ContainedDeps": DEPS
  189.     )
  190.     classifier '' //this is the main jar!
  191.  
  192.     from configurations.embed.collect {
  193.         exclude '.classpath'
  194.         exclude '.project'
  195.         exclude 'META-INF/LICENSE.txt'
  196.         exclude 'META-INF/NOTICE.txt'
  197.         exclude 'META-INF/LICENSE'
  198.         exclude 'META-INF/NOTICE'
  199.         exclude 'META-INF/DEPENDENCIES'
  200.         it.isDirectory() ? it : zipTree(it)
  201.     }
  202. }
  203.  
  204. processResources {
  205.     // this will ensure that this task is redone when the versions change.
  206.     inputs.property "version", project.version
  207.     inputs.property "mcversion", project.minecraft.version
  208.  
  209.     // replace stuff in mcmod.info, nothing else
  210.     from(sourceSets.main.resources.srcDirs) {
  211.         include 'mcmod.info'
  212.  
  213.         // replace version and mcversion
  214.         expand 'version':project.version, 'mcversion':project.minecraft.version
  215.     }
  216.        
  217.     // copy everything else except the mcmod.info
  218.     from(sourceSets.main.resources.srcDirs) {
  219.         exclude 'mcmod.info'
  220.     }
  221. }
  222.  
  223. curseforge {
  224.     apiKey = findProperty('curse_apiKey')
  225.     project {
  226.         id = '284797'
  227.         changelog = 'Some changes'
  228.         releaseType = 'release'
  229.         relations {
  230.             requiredLibrary 'mrcrayfishs-device-mod'
  231.         }
  232.     }
  233. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement