Skip to content

Commit

Permalink
Merge pull request #24 from madvay/lib-joda-time
Browse files Browse the repository at this point in the history
joda-convert and joda-time
  • Loading branch information
advayDev1 committed Sep 28, 2015
2 parents f1c0aef + d77be50 commit 97de001
Show file tree
Hide file tree
Showing 18 changed files with 166 additions and 46 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
30 changes: 29 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/.
45 changes: 0 additions & 45 deletions libraryBuilds/com.google.code.gson-gson/build.gradle

This file was deleted.

1 change: 1 addition & 0 deletions libraryBuilds/com.google.code.gson-gson/build.gradle
Original file line number Diff line number Diff line change
@@ -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()
}
1 change: 1 addition & 0 deletions libraryBuilds/com.google.code.gson-gson/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':com.google.code.gson-gson'
34 changes: 34 additions & 0 deletions libraryBuilds/common/build.gradle
Original file line number Diff line number Diff line change
@@ -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()
}
}
1 change: 1 addition & 0 deletions libraryBuilds/joda-time-joda-time/build.gradle
1 change: 1 addition & 0 deletions libraryBuilds/joda-time-joda-time/gradlew
28 changes: 28 additions & 0 deletions libraryBuilds/joda-time-joda-time/joda-time-joda-time/build.gradle
Original file line number Diff line number Diff line change
@@ -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()
}
1 change: 1 addition & 0 deletions libraryBuilds/joda-time-joda-time/local.properties
1 change: 1 addition & 0 deletions libraryBuilds/joda-time-joda-time/org.joda-joda-convert
1 change: 1 addition & 0 deletions libraryBuilds/joda-time-joda-time/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':org.joda-joda-convert', ':joda-time-joda-time'
1 change: 1 addition & 0 deletions libraryBuilds/org.joda-joda-convert/build.gradle
1 change: 1 addition & 0 deletions libraryBuilds/org.joda-joda-convert/gradlew
1 change: 1 addition & 0 deletions libraryBuilds/org.joda-joda-convert/local.properties
Original file line number Diff line number Diff line change
@@ -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()
}
1 change: 1 addition & 0 deletions libraryBuilds/org.joda-joda-convert/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':org.joda-joda-convert'
2 changes: 2 additions & 0 deletions libraryBuilds/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 97de001

Please sign in to comment.