Created
March 14, 2014 19:20
-
-
Save macalinao/9554850 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.tools.ant.filters.ReplaceTokens | |
apply plugin: 'java' | |
ext.pluginName = 'MattArena' | |
ext.desc = 'A 1v1 arena plugin for OG-MC.' | |
ext.author = 'AlbireoX' | |
ext.url = 'http://og-site.net' | |
ext.groupName = 'net.og_mc' | |
// Do not modify | |
ext.artifact = pluginName.toLowerCase() | |
ext.mainClass = groupName + '.' + artifact + '.' + pluginName | |
jar.baseName = artifact | |
defaultTasks 'clean', 'build', 'testmc' | |
repositories { | |
mavenCentral() | |
maven { | |
url 'http://repo.md-5.net/content/groups/public/' | |
} | |
maven { | |
url 'http://maven.sk89q.com/repo/' | |
} | |
} | |
dependencies { | |
compile group: 'org.bukkit', name: 'bukkit', version: '1.7.2-R0.3-SNAPSHOT' | |
compile group: 'com.sk89q', name: 'worldguard', version: '5.8.1-SNAPSHOT' | |
} | |
def getDescribe = { -> | |
try { | |
def code = new ByteArrayOutputStream() | |
exec { | |
commandLine 'git', 'describe', '--always', '--dirty=-dirty' | |
standardOutput = code | |
} | |
return code.toString().trim() | |
} | |
catch (ignored) { | |
return null; | |
} | |
} | |
processResources { | |
from('src/main/resources') { | |
include 'plugin.yml' | |
filter(ReplaceTokens, tokens: [ | |
pluginName: project.pluginName, | |
desc: project.desc, | |
version: getDescribe(), | |
author: project.author, | |
website: project.url, | |
mainClass: project.mainClass | |
]) | |
} | |
} | |
task testmc(type: Copy) { | |
from 'build/libs' | |
include '**/' + jar.baseName + '.jar' | |
into System.getProperty('user.home') + '/mc/plugins/' | |
} | |
task rekt(type:Exec) { | |
commandLine 'scp', './build/libs/' + jar.baseName + '.jar', 'ian@rekt.us:/home/ian/mc/plugins/' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment