Permalink
Browse files

Make YetToYes2.jar buildable by

gradle fatJar
on the YetToYes2 directory.
Also fix NPE bug on YetFileInput when there is a xref/footnote references but there are 0 xref/footnotes defined.
  • Loading branch information...
1 parent 7a7c1ba commit cc98315ce471c6945ecd4583e4284ec3972a2949 @yukuku committed Mar 24, 2015
Showing with 66 additions and 19 deletions.
  1. +0 −5 AlkitabConverter/src/android/os/Parcel.java
  2. +11 −0 AlkitabConverter/src/main/java/android/os/Parcel.java
  3. 0 AlkitabConverter/src/{ → main/java}/android/os/Parcelable.java
  4. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/Cek7BitFileTeks.java
  5. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/CekKebenaranMenjorok.java
  6. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/KonvertIsi.java
  7. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/KonvertPerikop.java
  8. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/OsisBookNames.java
  9. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/bdb/BdbProses.java
  10. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/col/ColProses.java
  11. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/col/CuvColProses.java
  12. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/daily_verse/DailyVerseProses.java
  13. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/internal_common/InternalCommon.java
  14. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/internal_common/ReverseIndexer.java
  15. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/reading_plan/RpaConverter.java
  16. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/unboundbible/UnboundBibleReader.java
  17. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/usfx_common/UsfxToYet.java
  18. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/CountingOutputStream.java
  19. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/DesktopShiftTb.java
  20. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/DesktopVerseFinder.java
  21. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/DesktopVerseParser.java
  22. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/FootnoteDb.java
  23. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/FormatXml.java
  24. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/Hitungan31102.java
  25. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/IntArrayList.java
  26. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/KjvUtils.java
  27. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/Patch.java
  28. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/Rec.java
  29. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/RecUtil.java
  30. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/TextDb.java
  31. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/Tmp.java
  32. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/Usfm2Usfx.java
  33. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/UsfmBookName.java
  34. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/XrefDb.java
  35. BIN AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/util/shift_tb_bt.bt
  36. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/yes1/RandomOutputStream.java
  37. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/yes1/Yes1File.java
  38. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/yes_common/Yes1Common.java
  39. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/yes_common/Yes2Common.java
  40. +2 −2 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/yet/YetFileInput.java
  41. 0 AlkitabConverter/src/{ → main/java}/yuku/alkitabconverter/yet/YetFileOutput.java
  42. +0 −9 AlkitabYes2/src/main/java/yuku/alkitab/yes2/model/SectionIndex.java
  43. +1 −0 YetToYes2/.gitignore
  44. +52 −0 YetToYes2/build.gradle
  45. +0 −3 YetToYes2/src/META-INF/MANIFEST.MF
  46. 0 YetToYes2/src/{ → main/java}/yuku/alkitabconverter/yet/YetToYes2.java
@@ -1,5 +0,0 @@
-package android.os;
-
-// Stub version of Android's Parcel
-public final class Parcel {
-}
@@ -0,0 +1,11 @@
+package android.os;
+
+// Stub version of Android's Parcel
+public final class Parcel {
+ public void writeInt(int a) {}
+ public void writeIntArray(int[] a) {}
+ public void writeString(String a) {}
+ public int readInt() { return 0; }
+ public int[] createIntArray() { return null; }
+ public String readString() { return null; }
+}
@@ -267,14 +267,14 @@ public YetFileInputResult parse(String nf) throws Exception {
}
for (final int arif : footnoteArifs.toArray()) {
- if (!res.footnoteEntries.containsKey(arif)) {
+ if (res.footnoteEntries == null || !res.footnoteEntries.containsKey(arif)) {
final int ari = arif >>> 8;
errors.add(String.format("footnote referenced in verse text not found: arif 0x%08x (book_1=%d, chapter_1=%d, verse_1=%d, field=%d)", arif, Ari.toBook(ari) + 1, Ari.toChapter(ari), Ari.toVerse(ari), arif & 0xff));
}
}
for (final int arif : xrefArifs.toArray()) {
- if (!res.xrefEntries.containsKey(arif)) {
+ if (res.xrefEntries == null || !res.xrefEntries.containsKey(arif)) {
final int ari = arif >>> 8;
errors.add(String.format("xref referenced in verse text not found: arif 0x%08x (book_1=%d, chapter_1=%d, verse_1=%d, field=%d)", arif, Ari.toBook(ari) + 1, Ari.toChapter(ari), Ari.toVerse(ari), arif & 0xff));
}
@@ -1,7 +1,6 @@
package yuku.alkitab.yes2.model;
import android.util.Log;
-import yuku.alkitab.yes2.BuildConfig;
import yuku.alkitab.yes2.io.RandomInputStream;
import yuku.bintex.BintexReader;
import yuku.bintex.ValueMap;
@@ -47,18 +46,10 @@
e.content_size = br.readInt();
br.skip(4); // reserved
res.entries.put(e.name, e);
-
- if (BuildConfig.DEBUG) {
- Log.d(TAG, "@@read: " + e.name + " offset=" + e.offset + " attributes_size=" + e.attributes_size + " content_size=" + e.content_size);
- }
}
res.sectionDataStartOffset = (int) input.getFilePointer();
- if (BuildConfig.DEBUG) {
- Log.d(TAG, "@@read start of section data offset: " + res.sectionDataStartOffset);
- }
-
return res;
}
@@ -0,0 +1 @@
+/build
@@ -0,0 +1,52 @@
+//
+// Script to build YetToYes2.jar
+//
+// Call gradle fatJar to compile this with dependencies included.
+//
+
+apply plugin: 'application'
+
+mainClassName = 'yuku.alkitabconverter.yet.YetToYes2'
+
+repositories {
+ mavenCentral()
+}
+
+configurations {
+ provided
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ compile 'net.sf.trove4j:trove4j:3.0.3'
+ provided files(System.getenv("ANDROID_HOME") + '/platforms/android-22/android.jar')
+}
+
+sourceSets {
+ main {
+ java {
+ srcDirs += '../AlkitabConverter/src/main/java'
+ srcDirs += '../AlkitabIo/src/main/java'
+ srcDirs += '../AlkitabModel/src/main/java'
+ srcDirs += '../AlkitabYes2/src/main/java'
+ srcDirs += '../BintexReader/src/main/java'
+ srcDirs += '../BintexWriter/src/main/java'
+ srcDirs += '../Snappy/src/main/java'
+ }
+ }
+}
+
+// Include provided for compilation
+sourceSets.main.compileClasspath += [configurations.provided]
+
+
+// create a single Jar with all dependencies
+task fatJar(type: Jar) {
+ manifest {
+ attributes 'Main-Class': mainClassName
+ }
+
+ from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
+ with jar
+}
+
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Main-Class: yuku.alkitabconverter.yet.YetToYes2
-

0 comments on commit cc98315

Please sign in to comment.