Skip to content

Commit

Permalink
Commit for the PR
Browse files Browse the repository at this point in the history
The pull request targets:

	1) Introduces Gradle support
	2) Updates maven support (even thou the apk generated is not
stable)
	3) Updates the setup_env.* scripts to support different building
tools
	4) Removes non UTF-8 characters
	5) Removes switches on R.id entries (not supported anymore from
ADT >= 14)
	6) Introduced a binary dependency (.aar) that replace the actionbarsherlock
sub-module

Remainders:

	1) Change the sub-module back to the owncloud android library
once the PR will be merge
  • Loading branch information
MMMarcy authored and stoyicker committed Oct 28, 2014
1 parent fe299fc commit 2cad715
Show file tree
Hide file tree
Showing 28 changed files with 896 additions and 97 deletions.
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ oc_framework/proguard-project.txt
oc_framework-test-project/proguard-project.txt
tests/proguard-project.txt

# Should not be commited inside this repo:
actionbarsherlock/
# Android Studio and Gradle specific entries
.gradle
.idea
*.iml
build

# Actionbarsherlock is now ignored since scripts takes care of init the sub-modules.
actionbarsherlock
5 changes: 1 addition & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "actionbarsherlock"]
path = actionbarsherlock
url = git://github.com/JakeWharton/ActionBarSherlock.git
[submodule "owncloud-android-library"]
path = owncloud-android-library
url = git://github.com/owncloud/android-library.git
url = git://github.com/owncloudChalmers/android-library.git
16 changes: 5 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
language: android
android:
components:
- platform-tools
- tools
- build-tools-20.0.0
- android-19
- android-17
- android-14
- extra-android-support
licenses:
- 'android-sdk-license-5be876d5'
- 'android-sdk-license-598b93a6'

jdk: oraclejdk7

before_install:
- rm pom.xml
- ./setup_env.sh

- ./setup_env.sh gradle
script:
- ./gradlew clean build
- ./setup_env.sh ant
- ant clean
- ant debug

86 changes: 55 additions & 31 deletions SETUP.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@

If you want to start help developing ownCloud please follow the [contribution guidelines][0] and observe these instructions.

If you have any problems, start again with 1) and work your way down. If something still does not work as described here, please open a new issue describing exactly what you did, what happened, and what should have happened.

### 1) Fork and download android/develop repository:
If you want to start help developing ownCloud please follow the [contribution guidelines][0] and observe these instructions:

NOTE: Android SDK with platforms 8, 14 and 19 (and maybe others) need to be installed.
You must have the Android SDK 'tools/', and 'platforms-tools/' folders in your environment path variable.
"git" need to be installed and in your environment path variable.
### 1. Fork and download android/develop repository:

NOTE: You must have git in your environment path variable to perform the next operations.

* Navigate to https://github.com/owncloud/android, click fork.
* Clone your new repo: "git clone git@github.com:YOURGITHUBNAME/android.git"
Expand All @@ -16,23 +12,28 @@ NOTE: Android SDK with platforms 8, 14 and 19 (and maybe others) need to be inst
* Pull changes from your develop branch: "git pull origin develop"
* Make official ownCloud repo known as upstream: "git remote add upstream git@github.com:owncloud/android.git"
* Make sure to get the latest changes from official android/develop branch: "git pull upstream develop"
* Complete the setup of project properties and resolve pending dependencies running "setup_env.bat" or "./setup_env.sh" .

At this point you can continue using different tools to build the project. Sections 2a), 2b), and 2c) describe some of the existing alternatives.
At this point you can continue using different tools to build the project. Section 2, 3, 4, 5 and 6 describe some of the existing alternatives.

### 2. Building with Ant:

### 2a) Building with Ant:

NOTE: You must have the Android SDK 'tools/', and 'platforms-tools/' folders in your environment path variable.

* Run "ant clean" .
* Resolve necessary dependencies running:
- Windows: "setup_env.bat ant"
- Mac OS/Linux: "./setup_env.sh ant"
* Run "ant clean".
* Run "ant debug" to generate a debuggable version of the ownCloud app.

### 2b) Building with console/maven:
### 3. Building with console/maven:

NOTE: You must have mvn (version >= 3.1.1) in your environment path. Current Android 'platforms-tools' need to be installed.

Download/install Android plugin for Maven, install owncloud-android-library, then build ownCloud with mvn:
Download/install Android plugin for Maven, then build ownCloud with mvn:

* Resolve necessary dependencies running:
- Windows: "setup_env.bat maven"
- Mac OS/Linux: "./setup_env.sh maven"
* cd ..
* git clone https://github.com/mosabua/maven-android-sdk-deployer.git
* cd maven-android-sdk-deployer
Expand All @@ -41,52 +42,75 @@ Download/install Android plugin for Maven, install owncloud-android-library, the
* mvn install
* cd ..

Now you can create ownCloud APK using "mvn package"
Now you can create ownCloud APK using "mvn package" and find it as ownCloud.apk under the target

### 4. Building with Gradle:

* Complete the setup of project properties running:
- Windows: "setup_env.bat gradle"
- Mac OS/Linux: "./setup_env.sh gradle"
* Open a terminal and go to the "android" directory that contains the repository.
* Run the 'clean' and 'build' tasks using the Gradle wrapper provided:
- Windows: gradlew.bat clean build
- Mac OS/Linux: ./gradlew clean build
* You can find the generated apk file in android/build/outputs/apk

### 2c) Building with Eclipse:
### 5. Building with Eclipse:

NOTE: You must have the Android SDK 'tools/', and 'platforms-tools/' folders in your environment path variable.

* Complete the setup of project properties and resolve pending dependencies running "setup_env.bat" or "./setup_env.sh" .
* Open Eclipse and create new "Android Project from Existing Code". Choose android/actionbarsherlock/library as root.
* Resolve necessary dependencies running:
- Windows: "setup_env.bat ant"
- Mac OS/Linux: "./setup_env.sh ant"
* Open Eclipse and create new "Android Project from Existing Code". Choose android/actionbarsherlock/library as root.
* Clean project and compile.
* If any error appear, check the project properties; in the 'Android' section, API Level should be greater or equal than 14.
* If "error loading libz.so.1" appears, try "sudo apt-get install lib32z1"
* If any error appears, check the project properties; in the 'Android' section, API Level should be greater or equal than 14.
* Make sure android/actionbarsherlock/library/bin/library.jar was created.
* Create a new "Android Project from Existing Code". Choose android/owncloud-android-library as root. (test and sample clients are not required.)
* Create a new "Android Project from Existing Code". Choose android/owncloud-android-library as root.
* Clean project and compile.
* If any error appear, check the project properties; in the 'Android' section, API Level should be 19 or greater.
* Make sure 'android/owncloud-android-library/bin/owncloud android library.jar' was created.
* If any error appears, check the project properties; in the 'Android' section, API Level should be 19 or greater.
* Make sure android/owncloud-android-library/bin/classes.jar was created.
* Import ownCloud Android project.
* Clean project and compile.
* If any error appears, check the project properties of owncloud-android project; in the 'Android' section:
- API Level should be 19 or greater.
- Two library projects should appear referred in the bottom square: actionbarsherlock/library and owncloud-android-library. Add them if needed.
- API Level should be 19 or greater.
- Two library projects should appear referred in the bottom square: actionbarsherlock/library and owncloud-android-library. Add them if needed.
* After those actions you should be good to go. HAVE FUN!

NOTE: Even though API level is set to 19, APK also runs on older devices because in AndroidManifest.xml minSdkVersion is set to 8.

### 3) Create pull request:

### 6. Building with Android Studio:

* Complete the setup of project properties running:
- Windows: "setup_env.bat gradle"
- Mac OS/Linux: "./setup_env.sh gradle"
* The first time you want to open the project in Android Studio, select 'Import Project...' and choose the file "android/settings.gradle".
Android Studio will then create the '.iml' files it needs. If you ever close the project but the files are still there, you just select
'Open Project...'. The file chooser will show an Android face as the folder icon, which you can select to reopen the project.
* To build the project, follow the guidelines shown on [4. Building with Gradle][2].

### 7. Create pull request:

NOTE: You must sign the [Contributor Agreement][1] before your changes can be accepted!

* Commit your changes locally: "git commit -a"
* Push your changes to your Github repo: "git push"
* Push your changes to your GitHub repo: "git push"
* Browse to https://github.com/YOURGITHUBNAME/android/pulls and issue pull request
* Click "Edit" and set "base:develop"
* Again, click "Edit" and set "compare:develop"
* Enter description and send pull request.

### 4) Create another pull request:
### 8. Create another pull request:

To make sure your new pull request does not contain commits which are already contained in previous PRs, create a new branch which is a clone of upstream/develop.

* git fetch upstream
* git checkout -b my_new_develop_branch upstream/develop
* If you want to rename that branch later: "git checkout -b my_new_develop_branch_with_new_name"
* Push branch to server: "git push -u origin name_of_local_develop_branch"
* Use Github to issue PR
* Use GitHub to issue PR


[0]: https://github.com/owncloud/android/blob/master/CONTRIBUTING.md
[1]: http://owncloud.org/about/contributor-agreement/
[2]: https://github.com/owncloud/android/blob/master/SETUP.md#4-building-with-gradle
1 change: 0 additions & 1 deletion actionbarsherlock
Submodule actionbarsherlock deleted from 9598f2
78 changes: 78 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.0'
}
}

apply plugin: 'com.android.application'


repositories {
mavenCentral()

flatDir {
dirs 'libs'
}
}

artifacts.add("default", file('libs/actionbarsherlock.aar'))

dependencies {
compile name: 'touch-image-view'
compile 'com.android.support:support-v4:19.1.0'
compile project('libs/actionbarsherlock_lib')
compile project(':owncloud-android-library')
compile 'com.jakewharton:disklrucache:2.0.2'
}

android {
compileSdkVersion 19
buildToolsVersion "20.0.0"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['res']
}

// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')

// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}

android {
lintOptions {
abortOnError false
}
}


compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}

productFlavors {
}

packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
}


Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Wed Oct 15 10:45:44 CEST 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-all.zip
Loading

0 comments on commit 2cad715

Please sign in to comment.