From 9e9b08afa241c2ae7206c81358a33c5a7d2f2b03 Mon Sep 17 00:00:00 2001 From: Normen Hansen Date: Sun, 23 Mar 2014 23:00:13 +0100 Subject: [PATCH] - add iOS to build - add optional libraries to SDK --- .gitignore | 6 +- jme3-ios/build.gradle | 8 +++ sdk/build.gradle | 127 +++++++++++++++++++++++------------------- settings.gradle | 1 + 4 files changed, 83 insertions(+), 59 deletions(-) create mode 100644 jme3-ios/build.gradle diff --git a/.gitignore b/.gitignore index 56edc512a..c973cd9b5 100644 --- a/.gitignore +++ b/.gitignore @@ -63,4 +63,8 @@ /sdk/jme3-glsl-support/build/ /netbeans/ /sdk/jme3-tests-template/src/com/jme3/gde/templates/tests/JmeTestsProject.zip -/sdk/jme3-tests-template/src/com/jme3/gde/templates/tests/JME3TestsAndroidProject.zip \ No newline at end of file +/sdk/jme3-tests-template/src/com/jme3/gde/templates/tests/JME3TestsAndroidProject.zip +/sdk/jme3-project-testdata/release/ +/sdk/JME3TestsTemplateAndroid/src/jme3test/ +/sdk/JME3TestsTemplate/src/jme3test/ +/jme3-ios/build/ \ No newline at end of file diff --git a/jme3-ios/build.gradle b/jme3-ios/build.gradle new file mode 100644 index 000000000..bc9321610 --- /dev/null +++ b/jme3-ios/build.gradle @@ -0,0 +1,8 @@ +if (!hasProperty('mainClass')) { + ext.mainClass = '' +} + +dependencies { + compile project(':jme3-core') + compile project(':jme3-plugins') +} diff --git a/sdk/build.gradle b/sdk/build.gradle index 9273faf6d..3240b218c 100644 --- a/sdk/build.gradle +++ b/sdk/build.gradle @@ -26,13 +26,18 @@ dependencies { corelibs project(':jme3-plugins') corelibs project(':jme3-terrain') + optlibs project(':jme3-bullet') + optlibs project(':jme3-jogl') + optlibs project(':jme3-android') + optlibs project(':jme3-ios') + if(buildNativeProjects == "true"){ + optlibs project(':jme3-android-native') + optlibs project(':jme3-bullet-native') + } testdatalibs project(':jme3-testdata') examplelibs project(':jme3-examples') - optlibs project(':jme3-bullet') - optlibs project(':jme3-jogl') - } artifacts { @@ -215,6 +220,63 @@ createBaseXml.inputs.files configurations.corelibs.resolve() createBaseXml.outputs.file "jme3-core-baselibs/nbproject/project.xml" createBaseXml.outputs.file "jme3-core-libraries/nbproject/project.xml" +task copyProjectLibs(dependsOn: [configurations.corelibs, configurations.testdatalibs]) <<{ + description "Copies the jar files needed to supply the J2SE Libraries in the "+ + "SDK to jme3-project-baselibs and jme3-project-libraries" + + // for each dependency in corelibs and optlibs.. + def deps = [] + deps.addAll(project.configurations.corelibs.dependencies) + deps.addAll(project.configurations.optlibs.dependencies) + deps.each {dep -> + // copy jme3 jar files, sources and javadocs to jme3-project-baselibs + dep.dependencyProject.configurations.archives.allArtifacts.each{ artifact-> + if(artifact.classifier == "sources"){ + copy { + from artifact.file + into "jme3-project-baselibs/release/libs/" + } + } else if(artifact.classifier == "javadoc"){ + copy { + from artifact.file + into "jme3-project-baselibs/release/libs/" + } + } else{ + copy { + from artifact.file + into "jme3-project-baselibs/release/libs/" + } + } + } + // copy external jar files to jme3-project-libraries + copy { + from dep.dependencyProject.configurations.compile.copyRecursive({ !(it instanceof ProjectDependency); }).resolve() + into "jme3-project-libraries/release/libs/" + } + } + + project.configurations.testdatalibs.dependencies.each {dep -> + // copy jme3 test data to jme3-project-testdata + dep.dependencyProject.configurations.archives.allArtifacts.each{ artifact-> + if(artifact.classifier == "sources"){ + } else if(artifact.classifier == "javadoc"){ + } else{ + copy { + from artifact.file + into "jme3-project-testdata/release/libs/" + rename ("jme3-testdata(.*)", "jme3-testdata.jar") + } + } + } + } +} +copyProjectLibs.inputs.files configurations.corelibs.resolve() +copyProjectLibs.inputs.files configurations.optlibs.resolve() +copyProjectLibs.inputs.files configurations.testdatalibs.resolve() +copyProjectLibs.outputs.dir "jme3-project-baselibs/release/libs/" +copyProjectLibs.outputs.dir "jme3-project-libraries/release/libs/" +copyProjectLibs.outputs.dir "jme3-project-testdata/release/libs/" + // workaround method to add a tag with the name "name" and "file" to an XML MarkupBuilder def makeName(builder, nameR) { builder.name nameR } def makeFile(builder, nameR) { builder.file(name:nameR, url:nameR) } @@ -226,7 +288,10 @@ task createProjectXml(dependsOn: configurations.corelibs) <<{ def j2seLibraries = [] // created J2SE library descriptors // for each dependency in corelibs.. - project.configurations.corelibs.dependencies.each {dep -> + def deps = [] + deps.addAll(project.configurations.corelibs.dependencies) + deps.addAll(project.configurations.optlibs.dependencies) + deps.each {dep -> def depJars = [] // jme3 jar files def depSources = [] // jme3 sources def depJavadocs = [] // jme3 javadoc @@ -307,60 +372,6 @@ createProjectXml.inputs.files configurations.corelibs.resolve() createProjectXml.inputs.files configurations.optlibs.resolve() createProjectXml.outputs.dir "jme3-project-baselibs/src/com/jme3/gde/project/baselibs/" -task copyProjectLibs(dependsOn: [configurations.corelibs, configurations.testdatalibs]) <<{ - description "Copies the jar files needed to supply the J2SE Libraries in the "+ - "SDK to jme3-project-baselibs and jme3-project-libraries" - - // for each dependency in corelibs.. - project.configurations.corelibs.dependencies.each {dep -> - // copy jme3 jar files, sources and javadocs to jme3-project-baselibs - dep.dependencyProject.configurations.archives.allArtifacts.each{ artifact-> - if(artifact.classifier == "sources"){ - copy { - from artifact.file - into "jme3-project-baselibs/release/libs/" - } - } else if(artifact.classifier == "javadoc"){ - copy { - from artifact.file - into "jme3-project-baselibs/release/libs/" - } - } else{ - copy { - from artifact.file - into "jme3-project-baselibs/release/libs/" - } - } - } - // copy external jar files to jme3-project-libraries - copy { - from dep.dependencyProject.configurations.compile.copyRecursive({ !(it instanceof ProjectDependency); }).resolve() - into "jme3-project-libraries/release/libs/" - } - } - - project.configurations.testdatalibs.dependencies.each {dep -> - // copy jme3 test data to jme3-project-testdata - dep.dependencyProject.configurations.archives.allArtifacts.each{ artifact-> - if(artifact.classifier == "sources"){ - } else if(artifact.classifier == "javadoc"){ - } else{ - copy { - from artifact.file - into "jme3-project-testdata/release/libs/" - rename ("jme3-testdata(.*)", "jme3-testdata.jar") - } - } - } - } -} -copyProjectLibs.inputs.files configurations.corelibs.resolve() -copyProjectLibs.inputs.files configurations.optlibs.resolve() -copyProjectLibs.inputs.files configurations.testdatalibs.resolve() -copyProjectLibs.outputs.dir "jme3-project-baselibs/release/libs/" -copyProjectLibs.outputs.dir "jme3-project-libraries/release/libs/" -copyProjectLibs.outputs.dir "jme3-project-testdata/release/libs/" - task copyTestSources <<{ project.configurations.examplelibs.dependencies.each{dep -> copy{ diff --git a/settings.gradle b/settings.gradle index a2efc0e1f..8b117586f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -21,6 +21,7 @@ include 'jme3-jbullet' include 'jme3-niftygui' include 'jme3-jogg' include 'jme3-android' +include 'jme3-ios' //native builds include 'jme3-bullet' //java