Skip to content

Commit

Permalink
DEF-2639 Classes.dex is now always built again (bugfix) (#40)
Browse files Browse the repository at this point in the history
* DEF-2639 Classes.dex is now always built again (bugfix)

* DEF-2639 review fixes
  • Loading branch information
mathiaswking authored Apr 10, 2017
1 parent 810f856 commit 2addab7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
4 changes: 0 additions & 4 deletions server/src/main/java/com/defold/extender/Extender.java
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,6 @@ public File buildClassesDex() throws ExtenderException {
extJars.addAll(getJars(extDir));
}

if (extJars.isEmpty()) {
return null;
}

Map<String, Object> context = context(platformConfig.context);
context.put("classes_dex", classesDex.getAbsolutePath());
context.put("jars", extJars);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,13 @@ public void buildAndroidCheckClassesDex() throws IOException, ExtenderClientExce

// Verify that classes.dex contains our Dummy class
DexFile dexFile = DexFileFactory.loadDexFile(tmpClassesDexPath.toFile().getAbsolutePath(), 19 ); // api level

List<String> expected = new ArrayList<>();
expected.add("Lcom/svenandersson/dummy/Dummy;");
expected.add("Lcom/defoldtest/engine/Engine;");

for (ClassDef classDef: dexFile.getClasses()) {
assertEquals("Lcom/svenandersson/dummy/Dummy;", classDef.getType());
assertTrue( expected.contains( classDef.getType() ) );
}
}
}
2 changes: 1 addition & 1 deletion server/test-data/sdk/a/defoldsdk/extender/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ platforms:

armv7-android:
context:
engineJars: []
engineJars: ["{{dynamo_home}}/share/java/Engine.jar"]
engineLibs: []

exePrefix: 'lib'
Expand Down
Binary file not shown.
3 changes: 3 additions & 0 deletions server/test-data/sdk/a/defoldsdk/share/java/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

javac -source 1.6 -target 1.6 -cp . com/defoldtest/engine/Engine.java
jar cvf Engine.jar com
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.defoldtest.engine;

public class Engine {
static public String Test() {
return "Hello from the SDK!!!";
}
}

0 comments on commit 2addab7

Please sign in to comment.