Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
language: android
sudo: required
dist: trusty
jdk: oraclejdk8

branches:
only:
- master
- develop
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
env:
global:
- ANDROID_API=27
- ANDROID_BUILD_TOOLS=27.0.3
android:
components:
- tools
- platform-tools
- build-tools-$ANDROID_BUILD_TOOLS
- android-$ANDROID_API
- extra-google-m2repository
- extra-android-m2repository # for design library
- addon-google_apis-google-19 # google play services
licenses:
- android-sdk-preview-license-.+
- android-sdk-license-.+
- google-gdk-license-.+
script:
- ./code-check.sh
after_success:
- ./bintray-upload.sh
17 changes: 17 additions & 0 deletions bintray-upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

if [ "$TRAVIS_BRANCH" == "master" ]; then
echo -e "\033[0;32m Start clean module \033[0m"
./gradlew :securestorage2library:clean
echo -e "Finished clean \033[0m"

echo -e "\033[0;32m Start install module \033[0m"
./gradlew :securestorage2library:install
echo -e "\033[0;32m Finished install \033[0m"

echo -e "\033[0;32m Start bintrayUpload \033[0m"
./gradlew :securestorage2library:bintrayUpload
echo -e "\033[0;32m Finished bintrayUpload \033[0m"
else
echo -e "\033[0;32m Current branch is not master, will not upload to bintray. \033[0m"
fi
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

buildscript {
ext.versionCode = 1
ext.versionName = '2.0.0'
ext.versionName = '0.0.1'
ext.kotlin_version = '1.2.41'
repositories {
google()
Expand Down
13 changes: 13 additions & 0 deletions code-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

echo -e "\033[0;32mStart normal check \033[0m"
./gradlew check
echo -e "\033[0;32m Finished normal check \033[0m"

echo -e "\033[0;32m Start checkstyle check \033[0m"
./gradlew checkstyle
echo -e "\033[0;32m Finished checkstyle check \033[0m"

echo -e "\033[0;32m Start ktlint check \033[0m"
./gradlew ktlint
echo -e "\033[0;32m Finished ktlint check \033[0m"
1 change: 1 addition & 0 deletions securestorage2library/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
68 changes: 68 additions & 0 deletions securestorage2library/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'com.github.dcendents.android-maven'

// Apply static code analysis configuration
apply from: './checks.gradle'

repositories {
mavenCentral()
jcenter()
}

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"

defaultConfig {
minSdkVersion 18
targetSdkVersion 27
versionCode versionCode
versionName "${versionName}"
}

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
disable 'UnusedResources', 'GoogleAppIndexingWarning'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
ktlint "com.github.shyiko:ktlint:0.24.0"
}

ext {
bintrayRepo = 'adorsys'
bintrayName = 'securestorage2'

publishedGroupId = 'de.adorsys.android'
libraryName = 'securestorage2'
artifact = 'securestorage2'

libraryDescription = 'securestorage2'

siteUrl = 'https://www.adorsys.de/'
gitUrl = 'https://github.com/adorsys/secure-storage2-android.git'

libraryVersion = "${versionName}"

developerId = 'andev'
developerName = 'Andev Adorsys'
developerEmail = 'adorsys.andev@gmail.com'

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}

apply from: 'https://raw.githubusercontent.com/adorsys/jcenter-distribution/master/installv.gradle'
apply from: 'https://raw.githubusercontent.com/adorsys/jcenter-distribution/master/bintrayv.gradle'
50 changes: 50 additions & 0 deletions securestorage2library/checks.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apply plugin: 'checkstyle'
apply plugin: 'pmd'

configurations {
ktlint
}

check.dependsOn('assembleDebug', 'checkstyle', 'pmd', 'lint', 'ktlint', 'ktlintFormat')

task checkstyle(type: Checkstyle) {
ignoreFailures true
configFile file("${project.rootDir}/config/checkstyle.xml")
source 'src'
include '**/*.java'
exclude '**/gen/**'

classpath = files()
}

task pmd(type: Pmd) {
ignoreFailures true
ruleSetFiles = files("${project.rootDir}/config/pmd.xml")
ruleSets = ["java-basic", "java-braces", "java-strings"]

source 'src'
include '**/*.java'
exclude '**/gen/**'

reports {
xml.enabled true
html.enabled true
}
}

task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
classpath = configurations.ktlint
main = "com.github.shyiko.ktlint.Main"
args "src/**/*.kt"
// to generate report in checkstyle format prepend following args:
// "--reporter=plain", "--reporter=checkstyle,output=${buildDir}/ktlint.xml"
// see https://github.com/shyiko/ktlint#usage for more
}

task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
classpath = configurations.ktlint
main = "com.github.shyiko.ktlint.Main"
args "-F", "src/**/*.kt"
}
30 changes: 30 additions & 0 deletions securestorage2library/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# 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 *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keepclasseswithmembers class de.adorsys.android.securestorage2library.SecureStorage {
static <fields>;
static <methods>;
}

-keep class de.adorsys.android.securestorage2library.internal.SecureStorageException** {
**[] $VALUES;
public *;
}
14 changes: 14 additions & 0 deletions securestorage2library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.adorsys.android.securestorage2library">

<application
android:allowBackup="false"
android:label="@string/app_name">
<provider
android:name=".internal.SecureStorageProvider"
android:authorities="${applicationId}.de.adorsys.android.securestorage2library"
android:enabled="true"
android:exported="false" />
</application>

</manifest>
Loading