Skip to content
Snippets Groups Projects
build.gradle 2.14 KiB
Newer Older
Spotlight Deveaux's avatar
Spotlight Deveaux committed
apply plugin: 'java'
apply plugin: 'maven'

group = 'io.github.packserver.RegPlug'
version = '0.0.1-SNAPSHOT'

sourceCompatibility = 1.8
targetCompatibility = 1.8

sourceSets {
    main {
        java {
            srcDir 'src/'
        }
        resources {
            if(System.getenv().containsKey("IS_RELEASE"))
            srcDirs = ['resources', 'config/false']
            else
            srcDirs = ['resources', 'config/true']
        }
    }
}

repositories {
    mavenCentral()
    maven { 
        name 'Spigot'
        url "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" 
    }
    maven {
        name 'BungeeCord'
        url 'https://oss.sonatype.org/content/repositories/snapshots'
    }
    maven { 
        name 'InventiveTalent'
        url "https://repo.inventivetalent.org/content/groups/public/" 
    }
}

// Simple hack for provided dependencies
configurations {
    provided
    compile.extendsFrom provided
}

dependencies {
    compile group: 'org.java-websocket', name: 'Java-WebSocket', version:'1.3.0'
    compile group: 'org.spigotmc', name: 'spigot-api', version:'1.10-R0.1-SNAPSHOT'
    compile group: 'org.bukkit', name: 'bukkit', version:'1.10-R0.1-SNAPSHOT'
Spotlight Deveaux's avatar
Spotlight Deveaux committed
}

// Simple hack for provided dependencies
jar {
    dependsOn configurations.runtime
    from {
        (configurations.runtime - configurations.provided).collect {
            it.isDirectory() ? it : zipTree(it)
        }
    } {
        exclude "META-INF/*.SF"
        exclude "META-INF/*.DSA"
        exclude "META-INF/*.RSA"
    }
}

task copyJarToBin(type: Copy) {
    from "${buildDir}/libs/RegPlug-0.0.1-SNAPSHOT.jar"
    if(System.getenv().containsKey("IS_RELEASE"))
    into "/Users/spotlight/Projects/RPi/toCopy"
    else
    // into "/Users/spotlight/Projects/Minecraft/Testing/plugins"
    into "/Users/spotlight/Projects/Minecraft/Testing/plugins"
}

task sendToPi(type: Exec,dependsOn:[copyJarToBin]) {
    if(System.getenv().containsKey("IS_RELEASE"))
    commandLine "bash", "/Users/spotlight/Projects/RPi/upload.sh", "RegPlug-0.0.1-SNAPSHOT.jar", "30632/plugins"
    else
    commandLine "/usr/bin/true"
}

sendToPi.mustRunAfter build
build.finalizedBy sendToPi