diff --git a/.travis.yml b/.travis.yml index dba3e73..6e44866 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,15 @@ os: osx # on Traivs. env: - TEST_DIR=com.google.code.gson-gson + - TEST_DIR=org.joda-joda-convert + - TEST_DIR=joda-time-joda-time + +matrix: + allow_failures: + # Blocked on https://github.com/JodaOrg/joda-convert/issues/7 + - env: TEST_DIR=org.joda-joda-convert + # Blocked on https://github.com/JodaOrg/joda-convert/issues/7 + - env: TEST_DIR=joda-time-joda-time branches: only: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3ca27c9..7582210 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,5 +44,33 @@ You are not required to run the system tests locally before creating a PR (they time and processing power), however if the tests fail on Travis you will need to update the PR until they pass. +#### Adding a new library + When you add a new library to build, make sure it is referenced in run-all.sh (for -human contributors) and in .travis.yml (for continuous builds). +human contributors) and in .travis.yml (for continuous builds). If your library has failures +add the env row to the allow_failures section of .travis.yml and document the blockers. + +The structure for each library to test is as follows: + +``` +libraryBuilds/ + - common/ - Existing directory with common build config + - dependencyLib1/ - Existing root of a library that newLibrary depends on + - dependencyLib1/ - Existing project for a library that newLibrary depends on + - dependencyLib2/ - Ditto. + - dependencyLib2/ - Ditto. + - newLibrary/ - New directory for the root project + - newLibrary/ - New directory for the library itself + - build.gradle - Build file containing j2objcTranslation directive for newLibrary + - dependencyLib1/ - Soft link to ../dependencyLib1/dependencyLib1/ + - dependencyLib2/ - Soft link to ../dependencyLib2/dependencyLib2/ + - build.gradle - Soft link to ../common/build.gradle, contains the preamble + - gradlew - Soft link to ../../j2objc-gradle/gradlew + - local.properties - Soft link to ../common/local.properties + - settings.gradle - 'include' directive for newLibrary and libraries it depends on +``` + +Every library newLibrary depends on must have its own similar structure as a top-level project, +as illustrated by dependencyLib1 and 2. Note the two level directory structure above: even if +your library has no dependencies, the build.gradle file for the library must lie 2 directories +below libraryBuilds1/. diff --git a/libraryBuilds/com.google.code.gson-gson/build.gradle b/libraryBuilds/com.google.code.gson-gson/build.gradle deleted file mode 100644 index a1c27e2..0000000 --- a/libraryBuilds/com.google.code.gson-gson/build.gradle +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2015 the authors of j2objc-common-libs-e2e-test - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -buildscript { - repositories { - jcenter() - } - dependencies { - // This is the build output of the plugin itself. - classpath fileTree(dir: '../../j2objc-gradle/build/libs', include: ['*.jar']) - } -} - -apply plugin: 'java' -apply plugin: 'com.github.j2objccontrib.j2objcgradle' - -repositories { - jcenter() -} - -dependencies { - j2objcTranslation 'com.google.code.gson:gson:2.3.1:sources' -} - -j2objcConfig { - // package-info.java exists in multiple packages. - filenameCollisionCheck false - - // Almost always there are no tests provided in an external source jar. - testMinExpectedTests 0 - finalConfigure() -} diff --git a/libraryBuilds/com.google.code.gson-gson/build.gradle b/libraryBuilds/com.google.code.gson-gson/build.gradle new file mode 120000 index 0000000..64ec370 --- /dev/null +++ b/libraryBuilds/com.google.code.gson-gson/build.gradle @@ -0,0 +1 @@ +../common/build.gradle \ No newline at end of file diff --git a/libraryBuilds/com.google.code.gson-gson/com.google.code.gson-gson/build.gradle b/libraryBuilds/com.google.code.gson-gson/com.google.code.gson-gson/build.gradle new file mode 100644 index 0000000..1456ab4 --- /dev/null +++ b/libraryBuilds/com.google.code.gson-gson/com.google.code.gson-gson/build.gradle @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2015 the authors of j2objc-common-libs-e2e-test + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +dependencies { + j2objcTranslation 'com.google.code.gson:gson:2.3.1:sources' +} + +j2objcConfig { + // package-info.java exists in multiple packages. + filenameCollisionCheck false + + // Almost always there are no tests provided in an external source jar. + testMinExpectedTests 0 + finalConfigure() +} diff --git a/libraryBuilds/com.google.code.gson-gson/settings.gradle b/libraryBuilds/com.google.code.gson-gson/settings.gradle new file mode 100644 index 0000000..fabd249 --- /dev/null +++ b/libraryBuilds/com.google.code.gson-gson/settings.gradle @@ -0,0 +1 @@ +include ':com.google.code.gson-gson' diff --git a/libraryBuilds/common/build.gradle b/libraryBuilds/common/build.gradle new file mode 100644 index 0000000..0c6591b --- /dev/null +++ b/libraryBuilds/common/build.gradle @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015 the authors of j2objc-common-libs-e2e-test + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +buildscript { + repositories { + jcenter() + } + dependencies { + // This is the build output of the plugin itself. + classpath fileTree(dir: '../../j2objc-gradle/build/libs', include: ['*.jar']) + } +} + +subprojects { + apply plugin: 'java' + apply plugin: 'com.github.j2objccontrib.j2objcgradle' + + repositories { + jcenter() + } +} diff --git a/libraryBuilds/joda-time-joda-time/build.gradle b/libraryBuilds/joda-time-joda-time/build.gradle new file mode 120000 index 0000000..64ec370 --- /dev/null +++ b/libraryBuilds/joda-time-joda-time/build.gradle @@ -0,0 +1 @@ +../common/build.gradle \ No newline at end of file diff --git a/libraryBuilds/joda-time-joda-time/gradlew b/libraryBuilds/joda-time-joda-time/gradlew new file mode 120000 index 0000000..bde144b --- /dev/null +++ b/libraryBuilds/joda-time-joda-time/gradlew @@ -0,0 +1 @@ +../../j2objc-gradle/gradlew \ No newline at end of file diff --git a/libraryBuilds/joda-time-joda-time/joda-time-joda-time/build.gradle b/libraryBuilds/joda-time-joda-time/joda-time-joda-time/build.gradle new file mode 100644 index 0000000..bcab554 --- /dev/null +++ b/libraryBuilds/joda-time-joda-time/joda-time-joda-time/build.gradle @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2015 the authors of j2objc-common-libs-e2e-test + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +dependencies { + compile project(':org.joda-joda-convert') + j2objcTranslation 'joda-time:joda-time:2.8.2:sources' +} + +j2objcConfig { + autoConfigureDeps true + + // No tests in the sources.jar. + testMinExpectedTests 0 + finalConfigure() +} diff --git a/libraryBuilds/joda-time-joda-time/local.properties b/libraryBuilds/joda-time-joda-time/local.properties new file mode 120000 index 0000000..217624b --- /dev/null +++ b/libraryBuilds/joda-time-joda-time/local.properties @@ -0,0 +1 @@ +../common/local.properties \ No newline at end of file diff --git a/libraryBuilds/joda-time-joda-time/org.joda-joda-convert b/libraryBuilds/joda-time-joda-time/org.joda-joda-convert new file mode 120000 index 0000000..c72745f --- /dev/null +++ b/libraryBuilds/joda-time-joda-time/org.joda-joda-convert @@ -0,0 +1 @@ +../org.joda-joda-convert/org.joda-joda-convert/ \ No newline at end of file diff --git a/libraryBuilds/joda-time-joda-time/settings.gradle b/libraryBuilds/joda-time-joda-time/settings.gradle new file mode 100644 index 0000000..b8a3854 --- /dev/null +++ b/libraryBuilds/joda-time-joda-time/settings.gradle @@ -0,0 +1 @@ +include ':org.joda-joda-convert', ':joda-time-joda-time' diff --git a/libraryBuilds/org.joda-joda-convert/build.gradle b/libraryBuilds/org.joda-joda-convert/build.gradle new file mode 120000 index 0000000..64ec370 --- /dev/null +++ b/libraryBuilds/org.joda-joda-convert/build.gradle @@ -0,0 +1 @@ +../common/build.gradle \ No newline at end of file diff --git a/libraryBuilds/org.joda-joda-convert/gradlew b/libraryBuilds/org.joda-joda-convert/gradlew new file mode 120000 index 0000000..bde144b --- /dev/null +++ b/libraryBuilds/org.joda-joda-convert/gradlew @@ -0,0 +1 @@ +../../j2objc-gradle/gradlew \ No newline at end of file diff --git a/libraryBuilds/org.joda-joda-convert/local.properties b/libraryBuilds/org.joda-joda-convert/local.properties new file mode 120000 index 0000000..217624b --- /dev/null +++ b/libraryBuilds/org.joda-joda-convert/local.properties @@ -0,0 +1 @@ +../common/local.properties \ No newline at end of file diff --git a/libraryBuilds/org.joda-joda-convert/org.joda-joda-convert/build.gradle b/libraryBuilds/org.joda-joda-convert/org.joda-joda-convert/build.gradle new file mode 100644 index 0000000..c6f4cbc --- /dev/null +++ b/libraryBuilds/org.joda-joda-convert/org.joda-joda-convert/build.gradle @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2015 the authors of j2objc-common-libs-e2e-test + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +dependencies { + j2objcTranslation 'org.joda:joda-convert:1.7:sources' +} + +j2objcConfig { + // No tests in the sources.jar. + testMinExpectedTests 0 + finalConfigure() +} diff --git a/libraryBuilds/org.joda-joda-convert/settings.gradle b/libraryBuilds/org.joda-joda-convert/settings.gradle new file mode 100644 index 0000000..37ce6c7 --- /dev/null +++ b/libraryBuilds/org.joda-joda-convert/settings.gradle @@ -0,0 +1 @@ +include ':org.joda-joda-convert' diff --git a/libraryBuilds/run-all.sh b/libraryBuilds/run-all.sh index 3c6d30f..1ea86e1 100755 --- a/libraryBuilds/run-all.sh +++ b/libraryBuilds/run-all.sh @@ -18,3 +18,5 @@ set -ev ./run-test.sh com.google.code.gson-gson +./run-test.sh org.joda-joda-convert +./run-test.sh joda-time-joda-time