Navigation Menu

Skip to content

Commit

Permalink
Make YetToYes2.jar buildable by
Browse files Browse the repository at this point in the history
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
yukuku committed Mar 24, 2015
1 parent 7a7c1ba commit cc98315
Show file tree
Hide file tree
Showing 46 changed files with 66 additions and 19 deletions.
5 changes: 0 additions & 5 deletions AlkitabConverter/src/android/os/Parcel.java

This file was deleted.

11 changes: 11 additions & 0 deletions AlkitabConverter/src/main/java/android/os/Parcel.java
@@ -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; }
}
File renamed without changes.
Expand Up @@ -267,14 +267,14 @@ public YetFileInputResult parse(String nf) throws Exception {
} }


for (final int arif : footnoteArifs.toArray()) { for (final int arif : footnoteArifs.toArray()) {
if (!res.footnoteEntries.containsKey(arif)) { if (res.footnoteEntries == null || !res.footnoteEntries.containsKey(arif)) {
final int ari = arif >>> 8; 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)); 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()) { for (final int arif : xrefArifs.toArray()) {
if (!res.xrefEntries.containsKey(arif)) { if (res.xrefEntries == null || !res.xrefEntries.containsKey(arif)) {
final int ari = arif >>> 8; 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)); 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));
} }
Expand Down
@@ -1,7 +1,6 @@
package yuku.alkitab.yes2.model; package yuku.alkitab.yes2.model;


import android.util.Log; import android.util.Log;
import yuku.alkitab.yes2.BuildConfig;
import yuku.alkitab.yes2.io.RandomInputStream; import yuku.alkitab.yes2.io.RandomInputStream;
import yuku.bintex.BintexReader; import yuku.bintex.BintexReader;
import yuku.bintex.ValueMap; import yuku.bintex.ValueMap;
Expand Down Expand Up @@ -47,18 +46,10 @@ static class Entry {
e.content_size = br.readInt(); e.content_size = br.readInt();
br.skip(4); // reserved br.skip(4); // reserved
res.entries.put(e.name, e); 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(); res.sectionDataStartOffset = (int) input.getFilePointer();


if (BuildConfig.DEBUG) {
Log.d(TAG, "@@read start of section data offset: " + res.sectionDataStartOffset);
}

return res; return res;
} }


Expand Down
1 change: 1 addition & 0 deletions YetToYes2/.gitignore
@@ -0,0 +1 @@
/build
52 changes: 52 additions & 0 deletions YetToYes2/build.gradle
@@ -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
}

3 changes: 0 additions & 3 deletions YetToYes2/src/META-INF/MANIFEST.MF

This file was deleted.

0 comments on commit cc98315

Please sign in to comment.