Skip to content

Commit

Permalink
added Gradle files and published AAR
Browse files Browse the repository at this point in the history
  • Loading branch information
commonsguy committed Dec 24, 2013
1 parent 20f4ee3 commit 16d4002
Show file tree
Hide file tree
Showing 19 changed files with 235 additions and 74 deletions.
4 changes: 2 additions & 2 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="lib" path="libs/CWAC-SackOfViewsAdapter.jar"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
7 changes: 0 additions & 7 deletions AndroidManifest.xml

This file was deleted.

39 changes: 36 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,40 @@ then attach your adapter to the `ListView`.
There is also `MergeSpinnerAdapter` for use with `Spinner`
widgets.

This is packaged as an Android library project, though
[a simple JAR is also available](https://github.com/commonsguy/cwac-merge/releases).
Installation
------------
This Android library project is
[available as a JAR](https://gihub.com/commonsguy/cwac-merge/releases).
If you wish to use the JAR, you will need to also add the JAR from
[the CWAC-Sacklist project](http://github.com/commonsguy/cwac-sacklist) to your
project

Also note that if you plan to use this as an Android library project
in source form, you
will also need to download [the CWAC-Sacklist project](http://github.com/commonsguy/cwac-sacklist)
(and, if needed, modify this project's configuration to point to your copy of
CWAC-Sacklist library project). Alternatively, download the CWAC-Sacklist JAR into
the `libs/` directory of your clone of this project and remove the dependency on
the CWAC-Sacklist library project.

This project is also available as
an artifact for use with Gradle. To use that, add the following
blocks to your `build.gradle` file:

```groovy
repositories {
maven {
url "https://repo.commonsware.com.s3.amazonaws.com"
}
}
dependencies {
compile 'com.commonsware.cwac:merge:1.0.1'
}
```

Or, if you cannot use SSL, use `http://repo.commonsware.com` for the repository
URL. This should automatically pull down the CWAC-Sacklist dependency.

Usage
-----
Expand Down Expand Up @@ -131,7 +163,7 @@ that do not work on API Level 4 and are not noted as requiring a higher version.

Version
-------
This is version v1.0.0 of this module.
This is version v1.0.1 of this module.

For those of you updating from a previous version, please note that you need
a new edition of the `SackOfViewsAdapter` JAR as well.
Expand Down Expand Up @@ -165,6 +197,7 @@ Do not ask for help via Twitter.

Release Notes
-------------
- v1.0.1: added Gradle files and published AAR
- v1.0.0: milestone considered reached
- v0.4.0: added `setActive()`
- v0.3.1: added workaround for http://code.google.com/p/android/issues/detail?id=16155
Expand Down
17 changes: 0 additions & 17 deletions ant.properties

This file was deleted.

5 changes: 2 additions & 3 deletions demo/.classpath
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="lib" path="/MergeAdapter/libs/CWAC-SackOfViewsAdapter.jar"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
40 changes: 40 additions & 0 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}

apply plugin: 'android'

repositories {
maven {
url "https://repo.commonsware.com.s3.amazonaws.com"
}
}

dependencies {
compile 'com.commonsware.cwac:merge:1.0.1'
}

android {
compileSdkVersion 17
buildToolsVersion "18.1.0"

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
20 changes: 20 additions & 0 deletions demo/proguard-project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
2 changes: 1 addition & 1 deletion demo/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

# Project target.
target=android-4
android.library.reference.1=..
android.library.reference.1=../merge
Binary file removed libs/CWAC-SackOfViewsAdapter.jar
Binary file not shown.
9 changes: 9 additions & 0 deletions merge/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
33 changes: 33 additions & 0 deletions merge/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>MergeAdapter</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
10 changes: 10 additions & 0 deletions merge/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.commonsware.cwac.merge"
android:versionCode="1"
android:versionName="1.0">

<application android:allowBackup="false">
</application>

</manifest>
59 changes: 59 additions & 0 deletions merge/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
classpath 'com.github.dcendents:android-maven-plugin:1.0'
}
}

apply plugin: 'android-library'
apply plugin: 'android-maven'

version '1.0.1'
group 'com.commonsware.cwac'

repositories {
maven {
url "https://repo.commonsware.com.s3.amazonaws.com"
}
}

dependencies {
compile 'com.commonsware.cwac:sacklist:1.0.0'
compile fileTree(dir: 'libs', include: '*.jar')
}

android {
compileSdkVersion 17
buildToolsVersion "18.1.0"

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}

// from http://stackoverflow.com/a/19484146/115145

android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name.equals(com.android.builder.BuilderConstants.DEBUG)) {
return; // Skip debug builds.
}
def task = project.tasks.create "jar${name.capitalize()}", Jar
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
// artifacts.add('archives', task);
}
File renamed without changes.
20 changes: 20 additions & 0 deletions merge/proguard-project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
4 changes: 3 additions & 1 deletion project.properties → merge/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@

android.library=true
# Project target.
target=android-4
target=android-7

android.library.reference.1=../../SackOfViewsAdapter/sacklist
40 changes: 0 additions & 40 deletions proguard.cfg

This file was deleted.

0 comments on commit 16d4002

Please sign in to comment.