Commit 93701deb authored by Grégory Mantelet's avatar Grégory Mantelet
Browse files

[UWS,TAP] Externalize `org.json`.

`org.json` was included in the sources of UWS-/TAP-Lib because of a manual
small correction. This is no longer needed. So this library is now a dependency
(included in the generated JAR). This has also been upgraded to the version of
August 2018.

_This commit aims to reproduce the original content of the Pull Request #38
 by @vforchi ._
parent 6d4554c2
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ Repository content
------------------

### Libraries
Each library has its own package (`adql` for ADQL, `uws` for UWS and `tap` for TAP). These packages are independent except `tap` which needs the two other packages. In addition to these packages, you will also find `cds` and `org.json` which are dependencies for the libraries.
Each library has its own package (`adql` for ADQL, `uws` for UWS and `tap` for TAP). These packages are independent except `tap` which needs the two other packages. In addition to these packages, you will also find `cds` which is a dependency for the libraries.

### Dependencies
Below are summed up the dependencies of each library:
@@ -40,15 +40,16 @@ Below are summed up the dependencies of each library:
| Package `cds.utils`    |  X   |     |  X  |
| Postgres JDBC Driver   |  X   |     |  X  |
| Package `uws`          |      |  X  |  X  |
| Package `org.json`     |      |  X  |  X  |
| JSON library            |      |  X  |  X  |
| HTTP Servlet API       |      |  X  |  X  |
| HTTP Multipart Library |      |  X  |  X  |
| Packages `cds.*`       |      |     |  X  |
| STIL Library           |      |     |  X  |

In the `lib` directory, you will find 2 JAR files:
In the `lib` directory, you will find 3 JAR files:
* The *HTTP Multipart Library*: `commons-fileupload-1.3.3.jar` (and `commons-io-2.6.jar`). This library helps dealing with uploads.
* The *[STIL Library](http://www.star.bris.ac.uk/~mbt/stil/)*: `stil_3.3-2.jar` (i.e. packages `nom.tap`, `org.apache.tools.bzip2`, `uk.ac.starlink`). This library helps supporting VOTable (read and write) and some other output formats.
* The *JSON Library*: `json-20180813.jar` (i.e. the former included package `org.json`). This library helps manipulating JSON content. _This library was already used (before v4.4 of UWS-Lib and v2.3 of TAP-Lib) but it was included in the sources instead of being considered as an external library._

The *Postgres JDBC Driver* is needed ONLY IF you want to use (and keep) `adql.translator.PgSphereTranslator`. You can get this driver on the [PostgreSQL website](https://jdbc.postgresql.org/download.html). The required package for the ADQL and TAP libraries is `org.postgresql` (and particularly the class `org.postgresql.Driver`).

+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ dependencies {
    compile 'org.slf4j:slf4j-api:1.7.25'
    compile 'commons-io:commons-io:2.6'
    compile 'commons-fileupload:commons-fileupload:1.3.3'
    compile 'org.json:json:20180813'

    testCompile 'junit:junit:4.12'
    testCompile 'com.h2database:h2:1.4.193'
+9 −2
Original line number Diff line number Diff line
@@ -23,6 +23,9 @@
	<property name="slf4jApiJarName" value="slf4j-api-1.7.25.jar" />
	<property name="slf4jApiJar" value="${libDir}/${slf4jApiJarName}" />
	
	<property name="jsonJarName" value="json-20180813.jar" />
	<property name="jsonJar" value="${libDir}/${jsonJarName}" />

	<property name="sqliteJarName" value="sqlite-jdbc-3.16.1.jar" />
	<property name="sqliteJar" value="${libDir}/${sqliteJarName}" />

@@ -35,9 +38,9 @@
	<property name="astroh2JarName" value="astroh2-0.3.jar" />
	<property name="astroh2Jar" value="${libDir}/${astroh2JarName}" />
		
	<property name="tapPath" value="tap/**,adql/**,uws/**,cds/**,datalink/**,puzzlibs/**" />
	<property name="tapPath" value="tap/**,adql/**,uws/**,cds/**" />
	<property name="jsonPath" value="org/json/**" />
	<property name="extLibsPath" value="com/oreilly/servlet/**,nom/tam/**,org/apache/tools/bzip2/**,uk/ac/starlink/**" />
	<property name="extLibsPath" value="org/slf4j/**,org/apache/commons/fileupload/**,org/apache/commons/io/**,nom/tam/**,org/apache/tools/bzip2/**,edu/jhu/**,gov/fnal/eag/healpix/**,uk/ac/**" />
	<property name="licensePath" value="COPYING.LESSER" />
	<property name="includesList" value="${tapPath},${jsonPath},${extLibsPath}" />

@@ -180,12 +183,14 @@
	<target name="buildLib" depends="compileLib,junitValidation" description="After 'clean', build the library JAR (only classes).">
		<echo>Generate the library:</echo>
		<jar basedir="${classesDir}" destfile="${libJarFileWithSTIL}" includes="${includesList}">
			<zipfileset src="${jsonJar}" excludes="META-INF/*" />
			<zipfileset src="${commonsIOJar}" excludes="META-INF/**" />
			<zipfileset src="${commonsFileUploadJar}" excludes="META-INF/**" />
			<zipfileset src="${stilJar}" excludes="META-INF/*" />
			<zipfileset dir="${srcDir}" includes="${licensePath}" />
		</jar>
		<jar basedir="${classesDir}" destfile="${libJarFile}" includes="${includesList}">
			<zipfileset src="${jsonJar}" excludes="META-INF/**" />
			<zipfileset src="${commonsIOJar}" excludes="META-INF/**" />
			<zipfileset src="${commonsFileUploadJar}" excludes="META-INF/**" />
			<zipfileset dir="${srcDir}" includes="${licensePath}" />
@@ -196,12 +201,14 @@
	<target name="buildLibAndSrc" depends="buildLib" description="After 'clean' and 'buildLib', build the sources JAR (only .java).">
		<jar compress="false" destfile="${srcJarFileWithSTIL}">
			<zipfileset dir="${srcDir}" includes="${includesList},${licensePath}" prefix="${srcDir}" />
			<zipfileset dir="${libDir}" includes="${jsonJarName}" fullPath="${jsonJar}" />
			<zipfileset dir="${libDir}" includes="${commonsIOJarName}" fullPath="${commonsIOJar}" />
			<zipfileset dir="${libDir}" includes="${commonsFileUploadJarName}" fullPath="${commonsFileUploadJar}" />
			<zipfileset dir="${libDir}" includes="${stilJarName}" fullPath="${stilJar}" />
		</jar>
		<jar compress="false" destfile="${srcJarFile}">
			<zipfileset dir="${srcDir}" includes="${includesList},${licensePath}" prefix="${srcDir}" />
			<zipfileset dir="${libDir}" includes="${jsonJarName}" fullPath="${jsonJar}" />
			<zipfileset dir="${libDir}" includes="${commonsIOJarName}" fullPath="${commonsIOJar}" />
			<zipfileset dir="${libDir}" includes="${commonsFileUploadJarName}" fullPath="${commonsFileUploadJar}" />
		</jar>
+6 −0
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@
	<property name="slf4jApiJarName" value="slf4j-api-1.7.25.jar" />
	<property name="slf4jApiJar" value="${libDir}/${slf4jApiJarName}" />
	
	<property name="jsonJarName" value="json-20180813.jar" />
	<property name="jsonJar" value="${libDir}/${jsonJarName}" />
	
	<property name="uwsPath" value="uws/**" />
	<property name="jsonPath" value="org/json/**" />
	<property name="licensePath" value="COPYING.LESSER" />
@@ -43,6 +46,7 @@
		<pathelement location="${commonsIOJar}" />
		<pathelement location="${commonsFileUploadJar}" />
		<pathelement location="${slf4jApiJar}" />
		<pathelement location="${jsonJar}" />
		<pathelement location="${SERVLET-API}" />
	</path>
	
@@ -113,6 +117,7 @@
	<target name="buildLib" depends="compileLib,junitValidation" description="After 'clean', build the library JAR (only classes).">
		<echo>Generate the library:</echo>
		<jar basedir="${classesDir}" destfile="${libJarFile}" includes="${includesList}">
			<zipfileset src="${jsonJar}" excludes="META-INF/*" />
			<zipfileset src="${commonsIOJar}" excludes="META-INF/**" />
			<zipfileset src="${commonsFileUploadJar}" excludes="META-INF/**" />
			<zipfileset dir="${srcDir}" includes="${licensePath}" />
@@ -123,6 +128,7 @@
	<target name="buildLibAndSrc" depends="buildLib" description="After 'clean' and 'buildLib', build the sources JAR (only .java).">
		<jar compress="false" destfile="${srcJarFile}">
			<zipfileset dir="${srcDir}" includes="${includesList},${licensePath}" prefix="${srcDir}" />
			<zipfileset dir="${libDir}" includes="${jsonJarName}" fullPath="${jsonJar}" />
			<zipfileset dir="${libDir}" includes="${commonsIOJarName}" fullPath="${commonsIOJar}" />
			<zipfileset dir="${libDir}" includes="${commonsFileUploadJarName}" fullPath="${commonsFileUploadJar}" />
		</jar>

lib/json-20180813.jar

0 → 100644
+63.1 KiB

File added.

No diff preview for this file type.

Loading