This commit is contained in:
Stefan Eggerstorfer
2013-09-03 18:47:59 +02:00
6 changed files with 120 additions and 0 deletions

6
.gitignore vendored
View File

@@ -5,3 +5,9 @@ builds/
superbin/
springloaded-*.jar
.DS_Store
/.idea
*.iml
*.ipr
*.iws
/.gradle
build/

16
build.gradle Normal file
View File

@@ -0,0 +1,16 @@
allprojects {
apply plugin: 'idea'
configurations {
tools
}
repositories {
mavenCentral()
}
}
subprojects {
apply plugin: 'java'
}

View File

@@ -0,0 +1,44 @@
def aspectjVersion = "1.7.1"
configurations {
aspects
ajInpath
}
dependencies {
tools "org.aspectj:aspectjtools:$aspectjVersion"
compile "cglib:cglib:2.2.2"
compile "org.aspectj:aspectjrt:$aspectjVersion"
compile 'asm:asm-all:3.2'
}
sourceSets {
main {
java {
srcDir 'src'
srcDir 'cglibsrc'
srcDir 'subsrc'
srcDir 'supersrc'
}
}
}
task compileJava(dependsOn: JavaPlugin.PROCESS_RESOURCES_TASK_NAME, overwrite: true) {
dependsOn configurations.tools.getTaskDependencyFromProjectDependency(true, "compileJava")
def srcDirs = sourceSets.main.java.srcDirs
srcDirs.each { inputs.dir it }
def destDir = sourceSets.main.output.classesDir
outputs.dir destDir
doLast {
ant.taskdef(resource: "org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties", classpath: configurations.tools.asPath)
ant.iajc(source:sourceCompatibility, target:targetCompatibility, destDir: destDir.absolutePath, maxmem:"512m", fork:"true",
aspectPath: configurations.aspects.asPath, inpath:configurations.ajInpath.asPath, sourceRootCopyFilter:"**/.svn/*,**/*.java",classpath:configurations.compile.asPath ){
sourceroots {
srcDirs.each {
if (it.exists()) pathelement location: it.absolutePath
}
}
}
}
}

View File

@@ -0,0 +1,52 @@
apply plugin: 'maven'
group = "org.springsource.loaded"
version = '1.1.1-dev'
jar.baseName = 'spring-loaded'
compileJava {
options.debug = true
}
dependencies {
compile 'asm:asm-all:3.2'
tools 'com.googlecode.jarjar:jarjar:1.3'
testCompile 'junit:junit:4.11'
testCompile project(':org.springsource.loaded.testdata')
}
test {
jvmArgs "-noverify"
}
task jarAll(type: Jar, dependsOn: jar) {
def metaInfDir = "$projectDir/META-INF"
inputs.files jar.archivePath
inputs.dir metaInfDir
classifier = 'agent'
doLast {
project.ant {
taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask", classpath: configurations.tools.asPath
jarjar(jarfile: archivePath, manifest: "$metaInfDir/MANIFEST.MF") {
zipfileset(dir: "$metaInfDir", prefix: 'META-INF')
zipfileset(src: jar.archivePath)
configurations.compile.files.each { jarjarFile ->
zipfileset(src: jarjarFile)
}
rule pattern: "org.objectweb.asm.**", result: "sl.org.objectweb.asm.@1"
}
}
}
}
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
// add the jars as artifacts
artifacts {
archives sourcesJar
archives jarAll
}

View File

2
settings.gradle Normal file
View File

@@ -0,0 +1,2 @@
include "org.springsource.loaded"
include "org.springsource.loaded.testdata"