Browse Source

Fixes #119 - The Library jme3-jbullet now has all the proper dependencies, so that jbullet should work again. Keep in mind though that jBullet is deprecated and will be removed in the future

MeFisto94 8 years ago
parent
commit
bf4514d4d1
2 changed files with 51 additions and 6 deletions
  1. 12 6
      build.gradle
  2. 39 0
      docs/libraries.md

+ 12 - 6
build.gradle

@@ -169,11 +169,11 @@ task createBaseXml(dependsOn: configurations.corelibs) <<{
         if (file.name.startsWith("jme3") && !isSourceOrJavadoc(file.name)){
         
             //collect jme jars
-            if(!jmeJarFiles.contains(file)){
-                    jmeJarFiles.add(file)
+            if(!jmeJarFiles.contains(file)) {
+                jmeJarFiles.add(file)
             }
             
-        }else if( !isSourceOrJavadoc(file.name)){
+        } else if(!isSourceOrJavadoc(file.name)) {
             //collect external jars
             externalJarFiles.add(file)
             
@@ -309,7 +309,7 @@ task copyProjectLibs(dependsOn: [configurations.corelibs, configurations.testdat
                 from dep
                 into "jme3-project-baselibs/release/libs/"
             }
-        }else{
+        } else{
             copy {
                 from dep
                 into "jme3-project-libraries/release/libs/"
@@ -375,7 +375,7 @@ task createProjectXml(dependsOn: configurations.corelibs) <<{
                 if(!jmeJarFiles.contains(file.name)){
                     jmeJarFiles.add(file.name)
                 }
-            }else{
+            } else{
                 if(!externalJarFiles.contains(file.name)){
                     externalJarFiles.add(file.name)
                 }
@@ -396,12 +396,18 @@ task createProjectXml(dependsOn: configurations.corelibs) <<{
                 if(!jmeJarFiles.contains(file.name)){
                     jmeJarFiles.add(file.name)
                 }
-            }else{
+            } else {
                 if(!externalJarFiles.contains(file.name)){
                     externalJarFiles.add(file.name)
                 }
             }
         }
+        
+        // Workarounds where the automatic dependency detection did not work. This is mainly when there are runtime dependencies which are not available as artifacts
+        if (dep.name.equals("jme3-jbullet")) {
+            externalJarFiles.add("jbullet.jar")
+            externalJarFiles.add("stack-alloc.jar")
+        }
 
         
         

+ 39 - 0
docs/libraries.md

@@ -0,0 +1,39 @@
+# Libraries
+The Libraries of the SDK enable the user to easily manage the engine dependencies. For this there are four (!) modules in place. This design seems a bit complicated, so maybe a refactoring might be good in the long run.  
+To further complicate the process, netbeans is ant and xml centric however the `project files` are dynamically generated using gradle (because the sdk gradually moved to gradle).
+
+## The Modules
+There are four modules in place: First there are the `-baselibs` and `-libraries` variants where the former are the actual engine libraries as you would specify them as dependencies and the latter are the external dependencies (i.e. dependencies needed by the engine. NiftyGUI has some dependencies, JBullet has some dependencies etc and those are in `-libraries`).  
+
+This means `jme3-core-baselibs` and `jme3-core-libraries` are the modules which actually store the binary data (i.e. the jar files in them).
+It seems to me, that those are only temporary since the other modules (`jme3-project-baselibs` and `jme3-project-libraries`) also store the jars in their release folders. Anyhow those are the modules you want to influence, their `src/com/jme3/gde/project/baselibs/*.xml` files are what define the actual Libraries.  
+
+If you have a look at the `build.gradle` file, you can see the process of building those xmls. The system is clever: You specify artifacts/dependencies and then the built xml automatically contains the dependencies specified by that dependency. Take `jme3-jbullet` for example:  
+The build.gradle for `jme3-jbullet` contains:  
+```
+dependencies {
+    compile ('java3d:vecmath:1.3.1')
+    compile files('../lib/jbullet.jar', '../lib/stack-alloc.jar')
+    compile project(':jme3-core')
+    compile project(':jme3-terrain')
+}
+```
+
+This leads to:  
+```xml
+<volume>
+    <type>classpath</type>
+    <resource>jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-jbullet-3.1.0-stable.jar!/</resource>
+    <resource>jar:nbinst://com.jme3.gde.project.libraries/libs/vecmath-1.3.1.jar!/</resource>
+  </volume>
+  <volume>
+    <type>src</type>
+    <resource>jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-jbullet-3.1.0-stable-sources.jar!/</resource>
+  </volume>
+  <volume>
+    <type>javadoc</type>
+    <resource>jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-jbullet-3.1.0-stable-javadoc.jar!/</resource>
+  </volume>
+```
+
+Here you unfortunately see that the `files()` dependency could not be picked up, the reason seems to be from within gradle, at least it does not appear in `jme3-jbullet`'s dependency list. That is why there was a needed workaround in the xml generation...