Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added Gradle build files and published AAR

  • Loading branch information...
commit 6b61ec2947eec7bf34f6b17e04cad8f07b69539a 1 parent 65d9438
@commonsguy authored
View
3  .classpath
@@ -3,6 +3,7 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <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>
View
25 README.markdown
@@ -18,9 +18,25 @@ So, CWAC offers an `AdapterWrapper` to fill this void.
By itself, it is not terribly interesting. However, other CWAC
projects, like [`EndlessAdapter`][endless], take advantage of it.
-This is packaged as an Android library project, though a simple
-JAR is also available from the Downloads section of this
-GitHub repository.
+This Android library project is
+[available as a JAR](https://github.com/commonsguy/cwac-adapter/releases)
+or 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:adapter:1.0.1'
+}
+```
+
+Or, if you cannot use SSL, use `http://repo.commonsware.com` for the repository
+URL.
Usage
-----
@@ -35,7 +51,7 @@ None at present.
Version
-------
-This is version v1.0 of this module. And there was much rejoicing.
+This is version v1.0.1 of this module. And there was much rejoicing.
Demo
----
@@ -62,6 +78,7 @@ Do not ask for help via Twitter.
Release Notes
-------------
+- v1.0.1: added Gradle build files and published AAR
- v1.0.0: made this the official 1.0 release
- v0.4.0: converted to Android library project
View
9 adapter/.classpath
@@ -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>
View
33 adapter/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>AdapterWrapper</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>
View
0  AndroidManifest.xml → adapter/AndroidManifest.xml
File renamed without changes
View
52 adapter/build.gradle
@@ -0,0 +1,52 @@
+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'
+
+dependencies {
+ compile fileTree(dir: 'libs', include: '*.jar')
+}
+
+android {
+ compileSdkVersion 4
+ 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);
+}
View
66 build.xml → adapter/build.xml
@@ -82,61 +82,15 @@
<!-- version-tag: custom -->
<import file="${sdk.dir}/tools/ant/build.xml" />
- <target name="dist-dir">
- <mkdir dir="dist"/>
- </target>
-
- <target name="dist-full" depends="dist-dir">
- <delete file="dist/CWAC-Adapter-full.zip" />
- <zip destfile="dist/CWAC-Adapter-full.zip">
- <zipfileset
- dir="."
- prefix="CWAC-Adapter"
- includes="**"
- excludes="bin/**, dist/**, gen/**, .git/**, .gitignore, demo/bin/**, demo/gen/**"
- />
- </zip>
- </target>
-
- <target name="dist-lite" depends="dist-dir">
- <delete file="dist/CWAC-Adapter-lite.zip" />
- <zip destfile="dist/CWAC-Adapter-lite.zip">
- <zipfileset
- dir="."
- prefix="CWAC-Adapter"
- includes="**"
- excludes="bin/**, dist/**, gen/**, .git/**, .gitignore, demo/**"
- />
- </zip>
- </target>
-
- <target name="jar" depends="debug">
- <jar
- destfile="bin/CWAC-Adapter.jar"
- basedir="bin/classes"
- />
- </target>
-
- <target name="dist-jar" depends="dist-dir, jar">
- <delete file="dist/CWAC-Adapter-jar.zip" />
- <copy file="bin/CWAC-Adapter.jar" todir="libs"/>
- <mkdir dir="tmp" />
- <mkdir dir="tmp/src" />
- <zip destfile="dist/CWAC-Adapter-jar.zip">
- <zipfileset
- dir="."
- prefix="CWAC-Adapter"
- includes="**"
- excludes="tmp/**, bin/**, dist/**, gen/**, .git/**, src/**, .gitignore, demo/**"
- />
- <zipfileset
- dir="tmp"
- prefix="CWAC-Adapter"
- includes="src/"
- />
- </zip>
- <delete dir="tmp"/>
- <delete file="libs/CWAC-Adapter.jar" />
- </target>
+ <target name="jar" depends="release">
+ <delete file="bin/CWAC-Adapter.jar" />
+ <jar destfile="bin/CWAC-Adapter.jar">
+ <fileset dir="bin/classes">
+ <exclude name="**/BuildConfig.class" />
+ <exclude name="**/R.class" />
+ <exclude name="**/R$*.class" />
+ </fileset>
+ </jar>
+ </target>
</project>
View
0  project.properties → adapter/project.properties
File renamed without changes
View
0  ...monsware/cwac/adapter/AdapterWrapper.java → ...monsware/cwac/adapter/AdapterWrapper.java
File renamed without changes
View
17 ant.properties
@@ -1,17 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked in Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
View
40 proguard.cfg
@@ -1,40 +0,0 @@
--optimizationpasses 5
--dontusemixedcaseclassnames
--dontskipnonpubliclibraryclasses
--dontpreverify
--verbose
--optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Application
--keep public class * extends android.app.Service
--keep public class * extends android.content.BroadcastReceiver
--keep public class * extends android.content.ContentProvider
--keep public class * extends android.app.backup.BackupAgentHelper
--keep public class * extends android.preference.Preference
--keep public class com.android.vending.licensing.ILicensingService
-
--keepclasseswithmembernames class * {
- native <methods>;
-}
-
--keepclasseswithmembers class * {
- public <init>(android.content.Context, android.util.AttributeSet);
-}
-
--keepclasseswithmembers class * {
- public <init>(android.content.Context, android.util.AttributeSet, int);
-}
-
--keepclassmembers class * extends android.app.Activity {
- public void *(android.view.View);
-}
-
--keepclassmembers enum * {
- public static **[] values();
- public static ** valueOf(java.lang.String);
-}
-
--keep class * implements android.os.Parcelable {
- public static final android.os.Parcelable$Creator *;
-}
Please sign in to comment.
Something went wrong with that request. Please try again.