-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from madvay/lib-gson
Adds testing scripts and Gson as first library.
- Loading branch information
Showing
9 changed files
with
199 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Please keep in mind that your "Contribution(s)" are submitted under | ||
the [Apache 2.0 License](LICENSE). | ||
|
||
#### Updating j2objc-gradle | ||
The version of j2objc-gradle in this repo is not automatically kept up | ||
to date with HEAD of https://github.com/j2objc-contrib/j2objc-gradle. | ||
|
||
As a submodule, you can update j2objc-gradle by doing: | ||
|
||
```shell | ||
# (start with a clean git working directory) | ||
# (from your local repo for this project) | ||
git checkout -b update-plugin | ||
pushd j2objc-gradle | ||
git pull | ||
popd | ||
git add . | ||
git commit -m 'Updating j2objc-gradle to HEAD' | ||
# (submit the update-plugin branch as a PR to the repo) | ||
``` | ||
|
||
Make sure this PR is seperate from any other work. If a library you want | ||
to build depends on the update, work in a new branch parented to the commit | ||
above. | ||
|
||
TODO: [Automate this](https://github.com/j2objc-contrib/j2objc-common-libs-e2e-test/issues/33) | ||
|
||
#### Library build verification | ||
|
||
On OS X we have system tests under the `libraryBuilds` directory. Each test directory | ||
has one root Gradle project (and zero or more subprojects), some or all of which apply the | ||
`j2objc-gradle` plugin. Locally you can run them as follows: | ||
|
||
```sh | ||
pushd libraryBuilds | ||
./prep.sh | ||
./run-all.sh | ||
# Normal Gradle build results will be displayed for each test project. | ||
popd | ||
``` | ||
|
||
These system tests are also run as part of OS X continuous integration builds on Travis. | ||
You are not required to run the system tests locally before creating a PR (they can take | ||
time and processing power), however if the tests fail on Travis you will need to update | ||
the PR until they pass. | ||
|
||
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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Ignore all the wrappers below. | ||
gradle/ | ||
gradlew.bat | ||
|
||
# local.properties is retained in this directory because | ||
# they are soft links to common/local.properties (below). | ||
!local.properties | ||
|
||
# Generated by prep.sh | ||
common/local.properties | ||
localJ2objcDist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* 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() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../j2objc-gradle/gradlew |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../common/local.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
# | ||
# 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. | ||
|
||
J2OBJC_VERSION=0.9.8.1 | ||
mkdir localJ2objcDist | ||
mkdir common | ||
|
||
# Fail if any command fails | ||
set -ev | ||
|
||
pushd localJ2objcDist | ||
|
||
DIST_DIR=j2objc-$J2OBJC_VERSION | ||
DIST_FILE=$DIST_DIR.zip | ||
|
||
# For developer local testing, don't keep redownloading the zip file. | ||
if [ ! -e $DIST_FILE ]; then | ||
curl -L https://github.com/google/j2objc/releases/download/$J2OBJC_VERSION/j2objc-$J2OBJC_VERSION.zip > $DIST_FILE | ||
unzip $DIST_FILE | ||
echo j2objc.home=$PWD/$DIST_DIR > ../common/local.properties | ||
fi | ||
|
||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
# | ||
# 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. | ||
|
||
# Fail if anything fails. | ||
set -ev | ||
|
||
./run-test.sh com.google.code.gson-gson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
# | ||
# 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. | ||
|
||
# Fail if anything fails. | ||
set -ev | ||
|
||
TEST_DIR=$1 | ||
echo Running test $TEST_DIR | ||
pushd $TEST_DIR | ||
./gradlew wrapper | ||
./gradlew clean | ||
./gradlew build | ||
popd |