[Git][java-team/libandroid-json-org-java][master] 4 commits: Update Vcs fields

Ximin Luo gitlab at salsa.debian.org
Thu Aug 16 09:10:47 BST 2018


Ximin Luo pushed to branch master at Debian Java Maintainers / libandroid-json-org-java


Commits:
43e6ac9f by Ximin Luo at 2018-08-13T07:45:24Z
Update Vcs fields

- - - - -
acb2a482 by Ximin Luo at 2018-08-13T10:22:01Z
Build two versions, needed by lizzie (ITP #906008)

- - - - -
34aff9c2 by Ximin Luo at 2018-08-13T10:22:41Z
Release 20121204-20090211-3 to Debian unstable.

- - - - -
cb837789 by Ximin Luo at 2018-08-13T10:49:12Z
Clarify wording

- - - - -


15 changed files:

- + debian/NEWS
- debian/README.Debian
- debian/changelog
- debian/control
- debian/libandroid-json-org-java-doc.doc-base.api
- debian/libandroid-json-org-java-doc.install
- + debian/libandroid-json-org-java.links
- debian/libandroid-json-org-java.poms
- debian/maven.rules
- + debian/patches-latest/api.patch
- + debian/patches-latest/series
- debian/debian.pom.xml → debian/pom.android.xml
- + debian/pom.latest.xml
- + debian/pom.xml
- debian/rules


Changes:

=====================================
debian/NEWS
=====================================
--- /dev/null
+++ b/debian/NEWS
@@ -0,0 +1,20 @@
+libandroid-json-org-java (20121204-20090211-3) unstable; urgency=medium
+
+  The following BREAKING changes were made:
+
+  - The "debian" version of the maven artifact has been reversioned to
+    "debian-android", this is only relevant for maven-debian-helper users
+    who may need to update their debian/maven.rules. It should not affect
+    ordinary users.
+
+  - The documentation no longer exists at /usr/share/doc/libandroid-json-org-java/api.
+    Instead you can find it at /usr/share/doc/libandroid-json-org-java/{android,latest}/api
+    depending on which version you want.
+
+  The following things are DEPRECATED and will be removed in a later release:
+
+  - /usr/share/java/json.jar now links to json-android.jar; the former will
+    be removed in the future. You should either use json-android.jar or
+    json-latest.jar as appropriate.
+
+ -- Ximin Luo <infinity0 at debian.org>  Mon, 13 Aug 2018 02:37:57 -0700


=====================================
debian/README.Debian
=====================================
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -7,3 +7,23 @@ The following classes however are included and might also be the most used:
 JSONArray, JSONException, JSONObject, JSONStringer, JSONTokener
 
  -- Thomas Koch <thomas at koch.ro>, Fri, 11 Jan 2013 21:38:27 +0100
+
+This package contains *TWO* versions of the org.json API. One version
+("android") is directly from upstream (Android) and reimplements an older
+version of Crockford's code. The other version ("latest") derives from the
+Android code but has been patched (see debian/patches-latest) to be more
+compatible with the latest version of Crockford's code.
+
+In particular, JSONException is unchecked since version 20131018 [1] but the
+Android API [2] still defines it as checked. Furthermore many of these API
+methods declare "throws JSONException". These cause build errors with newer
+projects such as Lizzie, so this Debian package builds both.
+
+[1] https://github.com/stleary/JSON-java/commit/0759465bdf9b7dc1bc61883735b3fb61c488d3b5
+[2] https://developer.android.com/reference/org/json/JSONException
+
+Currently these additional patches have only been lightly tested and are most
+likely incomplete and/or inefficient. If you need additional changes, please
+file a bug report against this package and we will be happy to accommodate you.
+
+ -- Ximin Luo <infinity0 at debian.org>  Mon, 13 Aug 2018 02:37:57 -0700


=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,20 @@
+libandroid-json-org-java (20121204-20090211-4) UNRELEASED; urgency=medium
+
+  * Clarify wording in README.Debian, the Android code is a completely new
+    reimplementation and was not forked from Crockford's code.
+
+ -- Ximin Luo <infinity0 at debian.org>  Mon, 13 Aug 2018 03:48:43 -0700
+
+libandroid-json-org-java (20121204-20090211-3) unstable; urgency=medium
+
+  * Update Vcs-* fields.
+  * Build another version that more closely matches API version 20180130
+    where JSONException is unchecked. This involves some minor breaking
+    changes (which should not affect normal users) and some deprecations that
+    developers need to respond to; see NEWS for details.
+
+ -- Ximin Luo <infinity0 at debian.org>  Mon, 13 Aug 2018 03:22:37 -0700
+
 libandroid-json-org-java (20121204-20090211-2) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
--- a/debian/control
+++ b/debian/control
@@ -2,12 +2,12 @@ Source: libandroid-json-org-java
 Section: java
 Priority: optional
 Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
-Uploaders: Thomas Koch <thomas at koch.ro>
-Build-Depends: debhelper (>= 9), default-jdk, maven-debian-helper (>= 1.5), junit4
+Uploaders: Thomas Koch <thomas at koch.ro>, Ximin Luo <infinity0 at debian.org>
+Build-Depends: debhelper (>= 9), default-jdk, maven-debian-helper (>= 1.5), junit4, quilt
 Build-Depends-Indep: default-jdk-doc, libmaven-javadoc-plugin-java
 Standards-Version: 3.9.6
-Vcs-Git: git://anonscm.debian.org/pkg-java/libandroid-json-org-java.git
-Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/libandroid-json-org-java.git
+Vcs-Git: https://salsa.debian.org/java-team/libandroid-json-org-java.git
+Vcs-Browser: https://salsa.debian.org/java-team/libandroid-json-org-java
 Homepage: https://android.googlesource.com/platform/libcore/+/master/json
 
 Package: libandroid-json-org-java


=====================================
debian/libandroid-json-org-java-doc.doc-base.api
=====================================
--- a/debian/libandroid-json-org-java-doc.doc-base.api
+++ b/debian/libandroid-json-org-java-doc.doc-base.api
@@ -6,5 +6,7 @@ Abstract: This is the API Javadoc provided for the
 Section: Programming
 
 Format: HTML
-Index: /usr/share/doc/libandroid-json-org-java/api/index.html
-Files: /usr/share/doc/libandroid-json-org-java/api/*
+Index: /usr/share/doc/libandroid-json-org-java/android/api/index.html
+Files: /usr/share/doc/libandroid-json-org-java/android/api/*
+Index: /usr/share/doc/libandroid-json-org-java/latest/api/index.html
+Files: /usr/share/doc/libandroid-json-org-java/latest/api/*


=====================================
debian/libandroid-json-org-java-doc.install
=====================================
--- a/debian/libandroid-json-org-java-doc.install
+++ b/debian/libandroid-json-org-java-doc.install
@@ -1,2 +1,2 @@
-target/apidocs/* usr/share/doc/libandroid-json-org-java/api
-
+v-android/target/apidocs/* usr/share/doc/libandroid-json-org-java/android/api
+v-latest/target/apidocs/* usr/share/doc/libandroid-json-org-java/latest/api


=====================================
debian/libandroid-json-org-java.links
=====================================
--- /dev/null
+++ b/debian/libandroid-json-org-java.links
@@ -0,0 +1 @@
+usr/share/java/json-android.jar usr/share/java/json.jar


=====================================
debian/libandroid-json-org-java.poms
=====================================
--- a/debian/libandroid-json-org-java.poms
+++ b/debian/libandroid-json-org-java.poms
@@ -25,4 +25,6 @@
 #   --site-xml=<location>: Optional, the location for site.xml if it needs to be installed.
 #     Empty by default. [mh_install]
 #
-pom.xml --has-package-version --java-lib --usj-name=json
+pom.xml --ignore-pom
+v-android/pom.xml --has-package-version --java-lib --usj-name=json-android
+v-latest/pom.xml --has-package-version --java-lib --usj-name=json-latest


=====================================
debian/maven.rules
=====================================
--- a/debian/maven.rules
+++ b/debian/maven.rules
@@ -16,5 +16,6 @@
 # and version starting with 3., replacing the version with 3.x
 #   junit junit jar s/3\..*/3.x/
 
-org.json json jar s/.*/debian/ * *
+org.json json jar s/2009.*/debian-android/ * *
+org.json json jar s/2018.*/debian-latest/ * *
 junit junit jar s/4\..*/4.x/


=====================================
debian/patches-latest/api.patch
=====================================
--- /dev/null
+++ b/debian/patches-latest/api.patch
@@ -0,0 +1,130 @@
+Index: 20180130/src/main/java/org/json/JSONException.java
+===================================================================
+--- 20180130.orig/src/main/java/org/json/JSONException.java
++++ 20180130/src/main/java/org/json/JSONException.java
+@@ -41,7 +41,7 @@ package org.json;
+  *     }
+  * }</pre>
+  */
+-public class JSONException extends Exception {
++public class JSONException extends RuntimeException {
+ 
+     public JSONException(String s) {
+         super(s);
+Index: 20180130/src/main/java/org/json/JSONTokener.java
+===================================================================
+--- 20180130.orig/src/main/java/org/json/JSONTokener.java
++++ 20180130/src/main/java/org/json/JSONTokener.java
+@@ -83,6 +83,15 @@ public class JSONTokener {
+         this.in = in;
+     }
+ 
++    private static String _helper(java.util.Scanner s) {
++        return s.hasNext() ? s.next() : "";
++    }
++
++    public JSONTokener(java.io.InputStream is) {
++        // trick from https://stackoverflow.com/questions/309424/read-convert-an-inputstream-to-a-string
++        this(is == null ? null : _helper(new java.util.Scanner(is).useDelimiter("\\A")));
++    }
++
+     /**
+      * Returns the next value from the input.
+      *
+Index: 20180130/src/test/java/org/json/JSONTokenerTest.java
+===================================================================
+--- 20180130.orig/src/test/java/org/json/JSONTokenerTest.java
++++ 20180130/src/test/java/org/json/JSONTokenerTest.java
+@@ -26,78 +26,78 @@ public class JSONTokenerTest extends Tes
+ 
+     public void testNulls() throws JSONException {
+         // JSONTokener accepts null, only to fail later on almost all APIs!
+-        new JSONTokener(null).back();
++        new JSONTokener((String)null).back();
+ 
+         try {
+-            new JSONTokener(null).more();
++            new JSONTokener((String)null).more();
+             fail();
+         } catch (NullPointerException e) {
+         }
+ 
+         try {
+-            new JSONTokener(null).next();
++            new JSONTokener((String)null).next();
+             fail();
+         } catch (NullPointerException e) {
+         }
+ 
+         try {
+-            new JSONTokener(null).next(3);
++            new JSONTokener((String)null).next(3);
+             fail();
+         } catch (NullPointerException e) {
+         }
+ 
+         try {
+-            new JSONTokener(null).next('A');
++            new JSONTokener((String)null).next('A');
+             fail();
+         } catch (NullPointerException e) {
+         }
+ 
+         try {
+-            new JSONTokener(null).nextClean();
++            new JSONTokener((String)null).nextClean();
+             fail();
+         } catch (NullPointerException e) {
+         }
+ 
+         try {
+-            new JSONTokener(null).nextString('"');
++            new JSONTokener((String)null).nextString('"');
+             fail();
+         } catch (NullPointerException e) {
+         }
+ 
+         try {
+-            new JSONTokener(null).nextTo('A');
++            new JSONTokener((String)null).nextTo('A');
+             fail();
+         } catch (NullPointerException e) {
+         }
+ 
+         try {
+-            new JSONTokener(null).nextTo("ABC");
++            new JSONTokener((String)null).nextTo("ABC");
+             fail();
+         } catch (NullPointerException e) {
+         }
+ 
+         try {
+-            new JSONTokener(null).nextValue();
++            new JSONTokener((String)null).nextValue();
+             fail();
+         } catch (NullPointerException e) {
+         }
+ 
+         try {
+-            new JSONTokener(null).skipPast("ABC");
++            new JSONTokener((String)null).skipPast("ABC");
+             fail();
+         } catch (NullPointerException e) {
+         }
+ 
+         try {
+-            new JSONTokener(null).skipTo('A');
++            new JSONTokener((String)null).skipTo('A');
+             fail();
+         } catch (NullPointerException e) {
+         }
+ 
+         assertEquals("foo! at character 0 of null",
+-                new JSONTokener(null).syntaxError("foo!").getMessage());
++                new JSONTokener((String)null).syntaxError("foo!").getMessage());
+ 
+-        assertEquals(" at character 0 of null", new JSONTokener(null).toString());
++        assertEquals(" at character 0 of null", new JSONTokener((String)null).toString());
+     }
+ 
+     public void testEmptyString() throws JSONException {


=====================================
debian/patches-latest/series
=====================================
--- /dev/null
+++ b/debian/patches-latest/series
@@ -0,0 +1 @@
+api.patch


=====================================
debian/debian.pom.xml → debian/pom.android.xml
=====================================
--- a/debian/debian.pom.xml
+++ b/debian/pom.android.xml
@@ -12,6 +12,9 @@ author of the json standard Douglas Crockford. His implementation however is
 not free software.
 Therefor the Android team did a cleanroom reimplementation of a json library
 to be used inplace of the original one.
+
+This version is used in Android and has a different API from the most recent
+version of org.json published on maven-central, see README.Debian for details.
   </description>
   <url>https://android.googlesource.com/platform/libcore/+/master/json</url>
   <licenses>


=====================================
debian/pom.latest.xml
=====================================
--- /dev/null
+++ b/debian/pom.latest.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.json</groupId>
+  <artifactId>json</artifactId>
+  <version>20180130</version>
+  <name>androids rewrite of the evil licensed json.org</name>
+  <packaging>jar</packaging>
+  <description>
+Json.org is a popular java library to parse and create json string from the
+author of the json standard Douglas Crockford. His implementation however is
+not free software.
+Therefor the Android team did a cleanroom reimplementation of a json library
+to be used inplace of the original one.
+
+This contains additional patches from Debian to bring the Android API in line
+with version 20180130 of the org.json API, see README.Debian for details.
+  </description>
+  <url>https://android.googlesource.com/platform/libcore/+/master/json</url>
+  <licenses>
+    <license>
+      <name>Apache License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
+    </license>
+  </licenses>
+  <organization>
+    <name>The Android Open Source Project</name>
+    <!--url></url-->
+  </organization>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+  <dependencies>
+    <dependency>
+        <groupId>junit</groupId>
+        <artifactId>junit</artifactId>
+        <version>4.x</version>
+        <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>


=====================================
debian/pom.xml
=====================================
--- /dev/null
+++ b/debian/pom.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.json</groupId>
+  <artifactId>json-all</artifactId>
+  <version>0</version>
+  <name>androids rewrite of the evil licensed json.org</name>
+  <packaging>pom</packaging>
+  <description>
+Json.org is a popular java library to parse and create json string from the
+author of the json standard Douglas Crockford. His implementation however is
+not free software.
+Therefor the Android team did a cleanroom reimplementation of a json library
+to be used inplace of the original one.
+  </description>
+  <url>https://android.googlesource.com/platform/libcore/+/master/json</url>
+  <licenses>
+    <license>
+      <name>Apache License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
+    </license>
+  </licenses>
+  <organization>
+    <name>The Android Open Source Project</name>
+    <!--url></url-->
+  </organization>
+
+  <modules>
+    <module>v-android</module>
+    <module>v-latest</module>
+  </modules>
+</project>


=====================================
debian/rules
=====================================
--- a/debian/rules
+++ b/debian/rules
@@ -5,10 +5,16 @@ export JAVA_HOME = /usr/lib/jvm/default-java
 %:
 	dh $@ --buildsystem=maven
 
-override_dh_auto_configure:
-	cp debian/debian.pom.xml pom.xml
+generate-sources:
+	cp debian/pom.xml pom.xml
+	mkdir -p v-android && cp -a src v-android/ && cp debian/pom.android.xml v-android/pom.xml
+	mkdir -p v-latest && cp -a src v-latest/ && cp debian/pom.latest.xml v-latest/pom.xml
+	cd v-latest && QUILT_PATCHES=../debian/patches-latest quilt push -a
+
+override_dh_auto_configure: generate-sources
 	dh_auto_configure
 
 override_dh_auto_clean:
 	dh_auto_clean
+	rm -rf v-android v-latest
 	rm -f pom.xml



View it on GitLab: https://salsa.debian.org/java-team/libandroid-json-org-java/compare/2290130903f5b2b837489f7b646e502d52f2f162...cb8377896008be9e7d0a94321d124e76cd637811

-- 
View it on GitLab: https://salsa.debian.org/java-team/libandroid-json-org-java/compare/2290130903f5b2b837489f7b646e502d52f2f162...cb8377896008be9e7d0a94321d124e76cd637811
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20180816/b63ffc22/attachment.html>


More information about the pkg-java-commits mailing list