Andrew2070 / Empires-Mod

The Empires Mod is designed to provide fun and reliable protection to modded Minecraft servers.
GNU Lesser General Public License v2.1
3 stars 2 forks source link

[Gradle] ShadowJar Not Excluding File Dependencies. #5

Closed Andrew2070 closed 6 years ago

Andrew2070 commented 7 years ago

Shadow Version: 1.2.4

Gradle Version: 2.0

Expected Behavior:

Wanting to exclude file dependencies.

Actual Behavior:

Does not have the means to exclude file dependencies in build.gradle

Gradle Build Script(s)


buildscript {
    repositories {
        mavenCentral()
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
        classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
    }
}

plugins {
  id 'java'
  id "com.matthewprenger.cursegradle" version "1.0.9"
  id 'com.github.johnrengelman.shadow' version '1.2.4'
  id 'net.saliman.cobertura' version '2.2.5'
  id 'com.github.kt3k.coveralls' version '2.0.1'
  id "se.bjurr.gitchangelog.git-changelog-gradle-plugin" version "1.50"
}

repositories {
    maven {
        name = "bukkit-repo"
        url = "http://repo.bukkit.org/content/groups/public/"
    }
    maven {
        name = "SpongePowered"
        url = "https://repo.spongepowered.org/maven"
    }
    maven {
        name = "sk89q"
        url = "http://maven.sk89q.com/artifactory/repo/"
    }
}

if (System.env.TRAVIS_TAG != null && !System.env.TRAVIS_TAG.isEmpty()) {
    ext.build_number = System.env.TRAVIS_TAG.substring(0, System.env.TRAVIS_TAG.length()-1)
    ext.build_type = System.env.TRAVIS_TAG.substring(System.env.TRAVIS_TAG.length()-1)
} else {
    ext.build_number = "0000"
    ext.build_type = "r"
}

// Apply Plugins
apply from: 'https://raw.githubusercontent.com/BuiltBrokenModding/BuiltBrokenScripts/buildScripts/index/index.gradle'
apply plugin: 'forge'
//apply plugin: 'curseforge'

// Configure Everything
version = "${minecraft.version}-${build_number}${build_type}"
println "reflectasmversion is " + reflectasmversion
minecraft {
   replace "@VERSION@", "${project.version}"
}

// Setup Deps
dependencies {
 // Database engines
    compile "org.xerial:sqlite-jdbc:3.8.5-pre1"
    compile "mysql:mysql-connector-java:5.1.32"

     // Minecraft related deps
    compile "com.forgeessentials:forgeessentials:1.4.1-SNAPSHOT:dev"
    compile files("libs/bukkit-1.7.9-R0.2.jar")
    compile "org.spongepowered:mixin:0.4.4-SNAPSHOT"
    //compile "com.sk89q.worldedit:worldedit-forge-mc1.7.10:6.0.2-SNAPSHOT:dev"

    // Other deps
    compile "org.beanshell:bsh:2.0b5"
    compile "com.esotericsoftware.reflectasm:reflectasm:${reflectasmversion}"
}

// Process Resources, injecting version numbers in
processResources {
    // this will ensure that this task is redone when the versions change.
    inputs.property "mod_version", project.version
    inputs.property "minecraft_version", minecraft.version
    inputs.property "reflectasmversion", project.reflectasmversion

    // replace stuff in mcmod.info, nothing else
    ['**/*.info', 'plugin.yml'].each {
        filesMatching(it) {
            expand 'mod_version'       : project.version,
                   'minecraft_version' : minecraft.version,
                   'reflectasmversion' : project.reflectasmversion
        }
    }
}

shadowJar {
    classifier = 'universal'
    dependencies {
    exclude(dependency('com.forgeessentials:forgeessentials:1.4.1-SNAPSHOT:dev'))
    exclude(dependency('com.sk89q.worldedit:worldedit-forge-mc1.7.10:6.0.2-SNAPSHOT:dev'))
    exclude(dependency('libs/bukkit-1.7.9-R0.2.jar")
    }
    manifest {
        attributes (
            'FMLCorePlugin': 'Empires.DepLoader',
            'FMLCorePluginContainsFMLMod': 'true'
        )
    }
}
// Setup Curse Upload task
curseforge {
    project {
        id = project_id
        changelog = file('changelog.html')
        changelogType = 'html'
        releaseType = build_type.equals('a') ? "alpha" : (build_type.equals('b') ? "beta" : "release")
    }
}
Andrew2070 commented 6 years ago

Fixed