Merge branch 'gradle-build' of https://github.com/ramonza/spring-loaded
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -5,3 +5,9 @@ builds/
|
||||
superbin/
|
||||
springloaded-*.jar
|
||||
.DS_Store
|
||||
/.idea
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
/.gradle
|
||||
build/
|
||||
|
||||
16
build.gradle
Normal file
16
build.gradle
Normal file
@@ -0,0 +1,16 @@
|
||||
allprojects {
|
||||
apply plugin: 'idea'
|
||||
|
||||
configurations {
|
||||
tools
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply plugin: 'java'
|
||||
}
|
||||
|
||||
44
org.springsource.loaded.testdata/build.gradle
Normal file
44
org.springsource.loaded.testdata/build.gradle
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
52
org.springsource.loaded/build.gradle
Normal file
52
org.springsource.loaded/build.gradle
Normal 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
|
||||
}
|
||||
0
org.springsource.loaded/settings.gradle
Normal file
0
org.springsource.loaded/settings.gradle
Normal file
2
settings.gradle
Normal file
2
settings.gradle
Normal file
@@ -0,0 +1,2 @@
|
||||
include "org.springsource.loaded"
|
||||
include "org.springsource.loaded.testdata"
|
||||
Reference in New Issue
Block a user