Skip to content

Commit

Permalink
Initial automation test
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanWang committed Jul 10, 2017
1 parent 84b6eb9 commit 279300d
Show file tree
Hide file tree
Showing 15 changed files with 146 additions and 39 deletions.
30 changes: 16 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ os:
- linux
android:
components:
#- tools
#- platform-tools
- build-tools-25.0.2
- android-25
- build-tools-26.0.0
- android-26
licenses:
- ".+"
before_install:
- openssl aes-256-cbc -K $encrypted_4c3a0fd697d8_key -iv $encrypted_4c3a0fd697d8_iv
-in files/glass.tar.enc -out glass.tar -d
- tar xvf glass.tar
- chmod +x gradlew
- export JAVA8_HOME=/usr/lib/jvm/java-8-oracle
- export JAVA_HOME=$JAVA8_HOME
- mkdir "$ANDROID_HOME/licenses" || true
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
before_script:
- chmod +x ./scripts/overlay-migration.sh
- "./scripts/overlay-migration.sh"
after_success:
- chmod +x ./generate-apk-release.sh
- "./generate-apk-release.sh"
- if [[ "$TRAVIS_BRANCH" != "master" ]]; then chmod +x ./generate-apk-release.sh;
./generate-apk-release.sh; fi
script:
- cd $TRAVIS_BUILD_DIR/
- "./gradlew assembleRelease"
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then ./gradlew publishApkClear_deltaClear_fullRelease;
else ./gradlew assembleClear_deltaClear_sampleRelease assembleDark_deltaDark_sampleRelease;
fi
notifications:
email: false
slack:
Expand All @@ -33,9 +33,11 @@ notifications:
on_success: always
on_failure: always
template:
- "MG Build <%{build_url}|#%{build_number}> (<%{compare_url}|%{commit}>) %{result} in %{duration}"
- MG Build <%{build_url}|#%{build_number}> (<%{compare_url}|%{commit}>) %{result}
in %{duration}
- "%{commit_subject}"
- "<https://github.com/PitchedApps/Material-Glass-Test-Builds/releases/tag/v%{build_number}|APK Download>"
- "<https://github.com/PitchedApps/Material-Glass-Test-Builds/releases/tag/v%{build_number}|APK
Download>"
sudo: true
cache:
directories:
Expand Down
7 changes: 1 addition & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.github.triplet.gradle:play-publisher:1.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

project.ext {
TARGET_SDK = 25
BUILD_TOOLS = "25.0.2"
ANDROID_SUPPORT_LIBS = "25.1.0"
}

allprojects {
repositories {
jcenter()
Expand Down
1 change: 1 addition & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## v3.2
* Framework: Complete rewrite for base colors
* Settings: Fixed sub setting crash for Oxygen based roms
* Whatsapp: Fixed crash and themed chat sections

## v3.1
* Started changelog and automation
Expand Down
5 changes: 5 additions & 0 deletions files/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
gplay-keys.json
play.keystore
play.properties
test.keystore
update-dev.sh
Binary file added files/glass.tar.enc
Binary file not shown.
10 changes: 10 additions & 0 deletions files/travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Add appropriate files for encryption

rm glass.tar.enc
cd ..
tar cvf glass.tar "files/gplay-keys.json" "files/play.keystore" "files/play.properties" "files/test.keystore"
travis encrypt-file glass.tar --add
rm glass.tar
mv glass.tar.enc files/
2 changes: 1 addition & 1 deletion generate-apk-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [ -s "builds/log.txt" ]; then # error occurred

echo "Create New Error Release"

API_JSON="$(printf '{"tag_name": "v%s","target_commitish": "master","name": "e%s","body": "Automatic Error Release e%s \\[Stable Release List\\]\\(https://github.com/PitchedApps/Material-Glass-Substratum/releases\\)","draft": false,"prerelease": false}' $TRAVIS_BUILD_NUMBER $TRAVIS_BUILD_NUMBER $TRAVIS_BUILD_NUMBER)"
API_JSON="$(printf '{"tag_name": "v%s","target_commitish": "master","name": "e%s","body": "Automatic Error Release e%s https://github.com/PitchedApps/Material-Glass-Substratum/releases","draft": false,"prerelease": false}' $TRAVIS_BUILD_NUMBER $TRAVIS_BUILD_NUMBER $TRAVIS_BUILD_NUMBER)"
newRelease="$(curl --data "$API_JSON" https://api.github.com/repos/$RELEASE_REPO/releases?access_token=$GITHUB_API_KEY)"
printf "Release Data\n%s\n" "$newRelease"
rID="$(echo "$newRelease" | jq ".id")"
Expand Down
10 changes: 4 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
# org.gradle.parallel=true
APP_TAG=Material Glass Substratum
APP_TAG_SHORT=MGS
APP_PACKAGE=com.pitchedapps.material.glass.substratum.github
APP_PACKAGE_SAMPLE=com.pitchedapps.material.glass.free.sample
APP_PACKAGE_PLAY=com.pitchedapps.material.glass.free
MIN_SDK=23
TARGET_SDK=25
BUILD_TOOLS=25.0.2
ANDROID_SUPPORT_LIBS=25.3.1
VERSION_NAME=3.2
VERSION_CODE=5
TARGET_SDK=26
BUILD_TOOLS=26.0.0
48 changes: 39 additions & 9 deletions substratum/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
plugins {
id 'com.gladed.androidgitversion' version '0.3.4'
}

apply plugin: 'com.android.application'
apply plugin: 'com.github.triplet.play'

play {
jsonFile = file('../files/gplay-keys.json')
track = 'alpha'
errorOnSizeLimit = true
uploadImages = false
untrackOld = true
}

android {
compileSdkVersion Integer.parseInt(project.TARGET_SDK)
buildToolsVersion project.BUILD_TOOLS

androidGitVersion {
codeFormat = 'MMNNPPBB'
format = '%tag%%.count%%-commit%'
prefix 'v'
}

defaultConfig {
applicationId project.APP_PACKAGE
applicationId project.APP_PACKAGE_SAMPLE
minSdkVersion Integer.parseInt(project.MIN_SDK)
targetSdkVersion Integer.parseInt(project.TARGET_SDK)
versionCode Integer.parseInt(project.VERSION_CODE)
versionName project.VERSION_NAME
versionCode androidGitVersion.code()
versionName androidGitVersion.name()
}

applicationVariants.all { variant ->
Expand All @@ -21,8 +39,19 @@ android {
}

signingConfigs {

def releaseProps = new Properties()
file("../files/play.properties").withInputStream { releaseProps.load(it) }

release {
storeFile file("../files/play.keystore")
storePassword releaseProps.getProperty('storePassword')
keyAlias releaseProps.getProperty('keyAlias')
keyPassword releaseProps.getProperty('keyPassword')
}

test {
storeFile file("../test.keystore")
storeFile file("../files/test.keystore")
storePassword "testkey"
keyAlias "testKey"
keyPassword "testkey"
Expand Down Expand Up @@ -50,22 +79,23 @@ android {
//base contains actual build flavours
Clear_sample {
dimension "base"
resValue "string", "app_name", "MGlass Clear Test"
resValue "string", "app_name", "MGlass Delta"
signingConfig signingConfigs.test
}
Clear_full {
applicationId project.APP_PACKAGE_PLAY
dimension "base"
resValue "string", "app_name", "MGlass Clear"
signingConfig signingConfigs.test
resValue "string", "app_name", "Material Glass"
signingConfig signingConfigs.release
}
Dark_sample {
dimension "base"
resValue "string", "app_name", "MGlass Dark Test"
resValue "string", "app_name", "MDark Delta"
signingConfig signingConfigs.test
}
Dark_full {
dimension "base"
resValue "string", "app_name", "MGlass Dark"
resValue "string", "app_name", "Material Dark"
signingConfig signingConfigs.test
}
}
Expand Down
44 changes: 44 additions & 0 deletions substratum/src/Clear_full/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<application
tools:node="replace"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/DialogStyle">>
<activity
android:name="com.pitchedapps.material.glass.free.SubstratumLauncher">
<intent-filter>
<action android:name="projekt.substratum.THEME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>

<meta-data
android:name="Substratum_Legacy"
android:value="true" />
<meta-data
android:name="Substratum_Name"
android:value="@string/ThemeName" />
<meta-data
android:name="Substratum_Author"
android:value="@string/ThemeAuthor" />
<meta-data
android:name="Substratum_Email"
android:value="@string/ThemeEmail" />
<meta-data
android:name="Substratum_ThemeReady"
android:value="@string/ThemeType" />

<!-- SUBSTRATUM INTERNAL USE: DO NOT TOUCH -->
<meta-data
android:name="Substratum_Plugin"
android:value="@string/ThemePlugin" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.pitchedapps.material.glass.free;

import com.pitchedapps.material.glass.SubstratumLauncherCore;

/**
* Created by Allan Wang on 2016-08-03.
*/
public class SubstratumLauncher extends SubstratumLauncherCore {

}
2 changes: 1 addition & 1 deletion substratum/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.pitchedapps.material.glass.substratum.github">
package="com.pitchedapps.material.glass.free.sample">

<application
android:allowBackup="true"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.pitchedapps.material.glass.substratum.github;
package com.pitchedapps.material.glass;

import android.app.Activity;
import android.app.AlertDialog;
Expand All @@ -11,6 +11,8 @@
import android.os.Bundle;
import android.widget.Toast;

import com.pitchedapps.material.glass.free.sample.R;

import java.io.File;
import java.util.ArrayList;

Expand All @@ -19,7 +21,7 @@
/**
* Created by Allan Wang on 2016-08-03.
*/
public class SubstratumLauncher extends Activity {
public class SubstratumLauncherCore extends Activity {

private static final String SUBSTRATUM_PACKAGE_NAME = "projekt.substratum";
private static final int MINIMUM_SUBSTRATUM_VERSION = 510; // 510 is the final MM build
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.pitchedapps.material.glass.free.sample;

import com.pitchedapps.material.glass.SubstratumLauncherCore;

/**
* Created by Allan Wang on 2016-08-03.
*/
public class SubstratumLauncher extends SubstratumLauncherCore {

}
Binary file removed test.keystore
Binary file not shown.

0 comments on commit 279300d

Please sign in to comment.