Split test app project out of root project.
This commit is contained in:
47
build.gradle
47
build.gradle
@@ -1,8 +1,9 @@
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'groovy'
|
||||
apply plugin: 'cpp'
|
||||
|
||||
allprojects {
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'maven'
|
||||
|
||||
repositories {
|
||||
@@ -10,20 +11,32 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
groovy 'org.codehaus.groovy:groovy:1.8.7'
|
||||
testCompile 'org.spockframework:spock-core:0.6-groovy-1.8'
|
||||
}
|
||||
|
||||
group = 'net.rubygrapefruit'
|
||||
version = '0.1'
|
||||
|
||||
mainClassName = 'net.rubygrapefruit.platform.Main'
|
||||
def nativeHeadersDir = file("$buildDir/nativeHeaders")
|
||||
sourceCompatibility = 1.5
|
||||
targetCompatibility = 1.5
|
||||
|
||||
configurations.compile.extendsFrom = []
|
||||
|
||||
uploadArchives {
|
||||
repositories {
|
||||
mavenDeployer {
|
||||
repository(url: uri("$rootProject.buildDir/repo"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
groovy 'org.codehaus.groovy:groovy:1.8.7'
|
||||
}
|
||||
|
||||
def nativeHeadersDir = file("$buildDir/nativeHeaders")
|
||||
|
||||
cpp {
|
||||
sourceSets {
|
||||
main
|
||||
@@ -101,28 +114,18 @@ task nativeHeaders {
|
||||
}
|
||||
}
|
||||
|
||||
def deployer = null
|
||||
uploadArchives {
|
||||
repositories {
|
||||
deployer = mavenDeployer {
|
||||
repository(url: uri("$buildDir/repo"))
|
||||
}
|
||||
}
|
||||
}
|
||||
def deployer = uploadArchives.repositories.mavenDeployer
|
||||
|
||||
libraries.all { lib ->
|
||||
def nativeJar = task("nativeJar${lib.name.capitalize()}", type: Jar) {
|
||||
from lib.spec.task
|
||||
baseName = lib.spec.baseName
|
||||
}
|
||||
startScripts.classpath += nativeJar.outputs.files
|
||||
applicationDistribution.from(nativeJar) {
|
||||
into 'lib'
|
||||
}
|
||||
lib.spec.task.dependsOn nativeHeaders
|
||||
test.dependsOn lib.spec.task
|
||||
artifacts {
|
||||
archives nativeJar
|
||||
runtime nativeJar
|
||||
}
|
||||
def jniPom = deployer.addFilter(lib.name) { artifact, file ->
|
||||
return file == nativeJar.archivePath
|
||||
@@ -137,16 +140,8 @@ javadoc {
|
||||
exclude '**/internal/**'
|
||||
}
|
||||
|
||||
applicationDistribution.from(javadoc) {
|
||||
into 'javadoc'
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives distZip
|
||||
}
|
||||
|
||||
def mainPom = deployer.addFilter('main') { artifact, file ->
|
||||
return file == distZip.archivePath || file == jar.archivePath
|
||||
return file == jar.archivePath
|
||||
}
|
||||
mainPom.groupId = project.group
|
||||
mainPom.artifactId = jar.baseName
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
rootProject.name = 'native-platform'
|
||||
|
||||
include 'testApp'
|
||||
|
||||
project(':testApp').projectDir = new File(rootDir, 'test-app')
|
||||
|
||||
14
test-app/build.gradle
Normal file
14
test-app/build.gradle
Normal file
@@ -0,0 +1,14 @@
|
||||
apply plugin: 'application'
|
||||
|
||||
mainClassName = 'net.rubygrapefruit.platform.Main'
|
||||
applicationName = 'native-platform-test'
|
||||
archivesBaseName = 'native-platform-test'
|
||||
|
||||
dependencies {
|
||||
compile project(':')
|
||||
}
|
||||
|
||||
configurations.archives.artifacts.clear()
|
||||
artifacts {
|
||||
archives distZip
|
||||
}
|
||||
Reference in New Issue
Block a user