-
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.
Adds testing scripts and Gson as first library.
- Loading branch information
Showing
9 changed files
with
194 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,49 @@ | ||
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 master 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. | ||
|
||
#### 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 | ||
# Once per git repository and/or new release of j2objc, run prep. | ||
pushd libraryBuilds && ./prep.sh && popd | ||
# This downloads j2objc and prepares the environment. | ||
|
||
# Every time you want to run the build tests: | ||
./gradlew build && pushd systemTests && ./run-all.sh && popd | ||
# Normal Gradle build results will be displayed for each test project. | ||
``` | ||
|
||
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,8 @@ | ||
# Ignore all the wrappers below. | ||
gradle/ | ||
gradlew.bat | ||
# Under this directory, we do in fact need to preserve local.properties! | ||
!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,44 @@ | ||
/* | ||
* 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 { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
j2objcTranslation 'com.google.code.gson:gson:2.3.1:sources' | ||
} | ||
|
||
j2objcConfig { | ||
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,34 @@ | ||
#!/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 | ||
|
||
# For developer local testing, don't keep redownloading the zip file. | ||
if [ ! -e j2objcDist.zip ]; then | ||
curl -L https://github.com/google/j2objc/releases/download/$J2OBJC_VERSION/j2objc-$J2OBJC_VERSION.zip > j2objcDist.zip | ||
unzip j2objcDist.zip | ||
mv j2objc-$J2OBJC_VERSION j2objcDist | ||
echo j2objc.home=$PWD/j2objcDist > ../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 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 |