Created
July 3, 2013 05:32
-
-
Save xconnecting/5915669 to your computer and use it in GitHub Desktop.
[Gradle] JSmooth Sample
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
apply plugin: 'groovy' | |
apply plugin: 'eclipse' | |
archivesBaseName = 'myapp' | |
ext.jsmoothHome = 'C:/program Files/JSmooth 0.9.9-7' | |
configurations { jsmooth } | |
repositories{ | |
flatDir dirs: "${jsmoothHome}/lib" | |
} | |
dependencies{ | |
groovy localGroovy() | |
jsmooth 'net.charabia:jsmoothgen-ant:@jar' | |
} | |
jar { | |
copy { | |
from configurations.runtime | |
into "lib" | |
} | |
def manifestClasspath = configurations.compile.collect{ 'lib/' + it.getName() }.join(' ') | |
manifest { | |
attributes "Main-Class" : "com.example.Main" | |
attributes 'Class-Path': manifestClasspath | |
} | |
from (configurations.compile.resolve().collect { it.isDirectory() ? it : fileTree(it) }) { | |
exclude 'META-INF/MANIFEST.MF' | |
exclude 'META-INF/*.SF' | |
exclude 'META-INF/*.DSA' | |
exclude 'META-INF/*.RSA' | |
exclude '**/*.jar' | |
} | |
} | |
build << { | |
ant.copy(file: 'build/libs/myapp.jar', todir: '.') | |
} | |
task jsmooth << { | |
def basedir = '.' | |
ant.taskdef(name:'jsmoothgen' | |
,classpath:configurations.jsmooth.asPath | |
, classname:"net.charabia.jsmoothgen.ant.JSmoothGen" | |
) | |
ant.jsmoothgen(project:"myapp.jsmooth" | |
,skeletonroot:"${jsmoothHome}/skeletons" | |
) | |
} | |
jsmooth.dependsOn(build) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment