Configure build.grade

* build shared and static libraries
* produce library artifacts
* produce general (empty) artifact that enforces dependencies
* update naming of library in artifact
This commit is contained in:
2014-11-26 14:20:23 +00:00
parent 5f925cd884
commit 39a4427a27
2 changed files with 29 additions and 8 deletions

11
.gitignore vendored
View File

@@ -1,5 +1,6 @@
/build/ build
/bin/ bin
/.gradle .gradle
/.settings .settings
/.classpath .classpath
.maven

View File

@@ -5,7 +5,7 @@ apply plugin: 'eclipse'
group = 'com.github.boukefalos' group = 'com.github.boukefalos'
project.archivesBaseName = 'libwiiuse' project.archivesBaseName = 'libwiiuse'
version = '0.13' version = '0.14'
task wrapper(type: Wrapper) { task wrapper(type: Wrapper) {
gradleVersion = '1.12' gradleVersion = '1.12'
@@ -75,7 +75,6 @@ libraries {
lib library: 'SetupAPI', linkage: 'static' lib library: 'SetupAPI', linkage: 'static'
lib library: 'WS2_32', linkage: 'static' lib library: 'WS2_32', linkage: 'static'
} }
} }
} }
@@ -116,8 +115,29 @@ binaries.withType(SharedLibraryBinary) { binary ->
jniPom.scopeMappings.mappings.clear() jniPom.scopeMappings.mappings.clear()
} }
def builderTask = binary.tasks.builder def builderTask = binary.tasks.builder
nativeJar.into(project.group.replace('.', '/') + '/' + variantName) { from builderTask.outputFile } def libraryDirectory = project.group.replace('.', '/') + "/${project.archivesBaseName}/${variantName}"
nativeJar.into(libraryDirectory) { from builderTask.outputFile }
nativeJar.dependsOn builderTask nativeJar.dependsOn builderTask
def importLibPath = binary.sharedLibraryLinkFile.absolutePath.replace('.dll', '.lib') def importLibPath = binary.sharedLibraryLinkFile.absolutePath.replace('.dll', '.lib')
linker.args "-Wl,--out-implib,${importLibPath}" linker.args "-Wl,--out-implib,${importLibPath}"
}
def mainPom = uploadArchives.repositories.mavenDeployer.pom
mainPom.groupId = project.group
mainPom.artifactId = jar.baseName
mainPom.version = project.version
mainPom.scopeMappings.mappings.clear()
mainPom.withXml { provider ->
def node = provider.asNode()
def deps = node.appendNode('dependencies')
['windows-amd64', 'windows-i386'].each { platform ->
def dep = deps.appendNode('dependency')
dep.appendNode('groupId', project.group)
dep.appendNode('artifactId', "${project.archivesBaseName}-${platform}")
dep.appendNode('version', project.version)
}
def dep = deps.appendNode('dependency')
dep.appendNode('groupId', 'com.github.boukefalos')
dep.appendNode('artifactId', 'jlibloader')
dep.appendNode('version', '0.2')
} }