diff --git a/.directory b/.directory deleted file mode 100644 index e37ffbc..0000000 --- a/.directory +++ /dev/null @@ -1,5 +0,0 @@ -[Dolphin] -Timestamp=2013,6,4,16,53,1 - -[Settings] -HiddenFilesShown=true diff --git a/.gitignore b/.gitignore index 37b67e2..bdbc634 100644 --- a/.gitignore +++ b/.gitignore @@ -1,40 +1,36 @@ -# built application files -*.apk -*.ap_ +#Android generated +bin +gen -# files for the dex VM -*.dex - -# Java class files -*.class - -# generated files -bin/ -gen/ -.gradle/ -**/build/ - -# Local configuration file (sdk path, etc) -local.properties - -library/.classpath -library/.project -sample/.classpath -sample/.project +#Eclipse +.project +.classpath +.settings #IntelliJ IDEA .idea *.iml *.ipr *.iws -classes -gen-external-apklibs -atlassian-ide-plugin.xml +out #Maven target release.properties pom.xml.* -#Others -.directory +#Ant +build.xml +local.properties +proguard.cfg +proguard-project.txt + +#Gradle +.gradle +build + +#OSX +.DS_Store + +#Personal Files +signing.properties diff --git a/build.gradle b/build.gradle index 0ceed26..2b75b6b 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,22 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:0.4' + classpath 'com.android.tools.build:gradle:0.5.+' } } +def isReleaseBuild() { + return version.contains("SNAPSHOT") == false +} + +allprojects { + version = VERSION_NAME + group = GROUP + + repositories { + mavenCentral() + } +} + +apply plugin: 'android-reporting' + diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..6982319 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,14 @@ +VERSION_NAME=1.1-SNAPSHOT +VERSION_CODE=3 +GROUP=io.github.johnkil + +POM_DESCRIPTION=In-layout android notifications +POM_URL=http://johnkil.github.io/Android-AppMsg +POM_SCM_URL=https://github.com/johnkil/Android-AppMsg +POM_SCM_CONNECTION=scm:git@github.com:johnkil/Android-AppMsg.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:johnkil/Android-AppMsg.git +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo +POM_DEVELOPER_ID=johnkil +POM_DEVELOPER_NAME=Evgeny Shishkin \ No newline at end of file diff --git a/library/AndroidManifest.xml b/library/AndroidManifest.xml index cc6d26f..8d7e086 100644 --- a/library/AndroidManifest.xml +++ b/library/AndroidManifest.xml @@ -1,10 +1,12 @@ + android:versionCode="3" + android:versionName="1.1" > + android:targetSdkVersion="18" /> + + \ No newline at end of file diff --git a/library/appmsg.jar b/library/appmsg.jar deleted file mode 100644 index 1f4fe53..0000000 Binary files a/library/appmsg.jar and /dev/null differ diff --git a/library/build.gradle b/library/build.gradle index bdaf6f7..788a254 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,18 +1,8 @@ -buildscript { - repositories { - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:0.5.+' - } -} - apply plugin: 'android-library' android { - compileSdkVersion 17 - buildToolsVersion '17' + compileSdkVersion 18 + buildToolsVersion '17.0.0' sourceSets { main { @@ -22,3 +12,6 @@ android { } } } + +// Used to push in maven +// apply from: '../maven_push.gradle' diff --git a/library/gradle.properties b/library/gradle.properties new file mode 100644 index 0000000..438a897 --- /dev/null +++ b/library/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME=Android-AppMsg Library +POM_ARTIFACT_ID=android-appmsg +POM_PACKAGING=aar \ No newline at end of file diff --git a/library/proguard-project.txt b/library/proguard-project.txt deleted file mode 100644 index f2fe155..0000000 --- a/library/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# 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 *; -#} diff --git a/library/project.properties b/library/project.properties index dfa4dd0..1b8c5a3 100644 --- a/library/project.properties +++ b/library/project.properties @@ -11,5 +11,5 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-16 +target=android-18 android.library=true diff --git a/maven_push.gradle b/maven_push.gradle new file mode 100644 index 0000000..ab35ba1 --- /dev/null +++ b/maven_push.gradle @@ -0,0 +1,82 @@ +apply plugin: 'maven' +apply plugin: 'signing' + +def sonatypeRepositoryUrl +if (isReleaseBuild()) { + println 'RELEASE BUILD' + sonatypeRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" +} else { + println 'DEBUG BUILD' + sonatypeRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/" +} + +afterEvaluate { project -> + uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + pom.artifactId = POM_ARTIFACT_ID + + repository(url: sonatypeRepositoryUrl) { + authentication(userName: nexusUsername, password: nexusPassword) + } + + pom.project { + name POM_NAME + packaging POM_PACKAGING + description POM_DESCRIPTION + url POM_URL + + scm { + url POM_SCM_URL + connection POM_SCM_CONNECTION + developerConnection POM_SCM_DEV_CONNECTION + } + + licenses { + license { + name POM_LICENCE_NAME + url POM_LICENCE_URL + distribution POM_LICENCE_DIST + } + } + + developers { + developer { + id POM_DEVELOPER_ID + name POM_DEVELOPER_NAME + } + } + } + } + } + } + + signing { + required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } + sign configurations.archives + } + + task androidJavadocs(type: Javadoc) { + source = android.sourceSets.main.allJava + } + + task androidJavadocsJar(type: Jar) { + classifier = 'javadoc' + //basename = artifact_id + from androidJavadocs.destinationDir + } + + task androidSourcesJar(type: Jar) { + classifier = 'sources' + //basename = artifact_id + from android.sourceSets.main.allSource + } + + artifacts { + //archives packageReleaseJar + archives androidSourcesJar + archives androidJavadocsJar + } +} \ No newline at end of file