Skip to content

Commit

Permalink
Work for build Android aar bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
developernotes committed Sep 25, 2015
1 parent 098ecdb commit f69ad03
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -11,3 +11,4 @@ gen/
external/openssl
external/sqlcipher
libs/
*.zip
18 changes: 3 additions & 15 deletions AndroidManifest.xml
@@ -1,17 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.sqlcipher" android:versionCode="4"
android:versionName="v1 (0.0.6.FINAL)">
<uses-sdk android:minSdkVersion="7"></uses-sdk>
<application android:icon="@drawable/icon" android:label="@string/app_name">

<activity android:name="example.SQLDemoActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>


</manifest>
package="net.sqlcipher" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
</manifest>
14 changes: 10 additions & 4 deletions Makefile
Expand Up @@ -7,11 +7,10 @@ SQLCIPHER_DIR := ${EXTERNAL_DIR}/sqlcipher
LICENSE := SQLCIPHER_LICENSE
ASSETS_DIR := assets
OPENSSL_DIR := ${EXTERNAL_DIR}/openssl
GIT_DESCRIBE := $(shell git describe)
LATEST_TAG := $(shell git tag | sort -r | head -1)
SECOND_LATEST_TAG := $(shell git tag | sort -r | head -2 | tail -1)
RELEASE_DIR := sqlcipher-for-android-${GIT_DESCRIBE}
CHANGE_LOG_HEADER := "Changes included in the ${GIT_DESCRIBE} release of SQLCipher for Android:"
RELEASE_DIR := sqlcipher-for-android-${LATEST_TAG}
CHANGE_LOG_HEADER := "Changes included in the ${LATEST_TAG} release of SQLCipher for Android:"
README := ${RELEASE_DIR}/README

# Use faketime to freeze time to make for reproducible builds.
Expand Down Expand Up @@ -53,7 +52,14 @@ build-jni:
build-java:
$(FAKETIME_5) ant release

release:
release: release-zip release-aar

release-aar: release
-rm libs/sqlcipher.jar
-rm libs/sqlcipher-javadoc.jar
mvn package

release-zip:
-rm -rf ${RELEASE_DIR}
-rm ${RELEASE_DIR}.zip
mkdir ${RELEASE_DIR}
Expand Down
124 changes: 124 additions & 0 deletions pom.xml
@@ -0,0 +1,124 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.zetetic</groupId>
<artifactId>android-database-sqlcipher</artifactId>
<version>3.3.1</version>
<packaging>aar</packaging>
<name>android-database-sqlcipher</name>
<description>
SQLCipher for Android is a plugin to SQLite that provides full database encryption.
</description>
<url>https://www.zetetic.net/sqlcipher/</url>
<licenses>
<license>
<url>https://www.zetetic.net/sqlcipher/license/</url>
</license>
</licenses>
<developers>
<developer>
<name>Zetetic Support</name>
<email>support@zetetic.net</email>
<organization>Zetetic LLC</organization>
<organizationUrl>https://www.zetetic.net/</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/sqlcipher/android-database-sqlcipher.git</connection>
<developerConnection>scm:git:https://github.com/sqlcipher/android-database-sqlcipher.git</developerConnection>
<url>https://github.com/sqlcipher/android-database-sqlcipher.git</url>
</scm>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<directory>bin/</directory>
<plugins>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>4.3.0</version>
<extensions>true</extensions>
<configuration>
<sign>
<debug>false</debug>
</sign>
<androidManifestFile>AndroidManifest.xml</androidManifestFile>
<resourceDirectory>res</resourceDirectory>
<assetsDirectory>assets</assetsDirectory>
<nativeLibrariesDirectory>libs</nativeLibrariesDirectory>
<release>true</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<keyname>97ED25C2</keyname>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.3</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.0.1.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

0 comments on commit f69ad03

Please sign in to comment.