Skip to content

Commit 78a4968

Browse files
committed
add release build type
1 parent f4b8e06 commit 78a4968

File tree

8 files changed

+61
-32
lines changed

8 files changed

+61
-32
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ freeline.py
5050
freeline/
5151
freeline_project_description.json
5252
/art/
53+
/gradle.properties

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# next-kotlin
22
Kotlin version of [Next music player](https://github.com/jonashao/next)
3+
34
*Welcome to join and contribute.*
45

5-
This is an extremely simple music player, only let user to swipe to skip ,
6+
This is an extremely simple music player, only letting user to swipe to skip ,
67
or pause and start playing music.
8+
And, It super saves power, compared to wechat and facebook, its power consumption can be ignored.
79

810
It might be a good example for learning Kotlin, android music player,
911
mvp framework, dagger and Realm, since it's simple and clean.

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/build
2+
/release/

app/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,22 @@ android {
1616
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1717
vectorDrawables.useSupportLibrary = true
1818
}
19+
signingConfigs {
20+
config {
21+
keyAlias project.hasProperty("ALIAS_NAME") ? ALIAS_NAME : System.getenv("ALIAS_NAME")
22+
keyPassword project.hasProperty("ALIAS_PASS") ? ALIAS_PASS : System.getenv("ALIAS_PASS")
23+
storeFile file('../keys/koche_keystore.jks')
24+
storePassword project.hasProperty("KEYSTORE_PASS") ? KEYSTORE_PASS : System.getenv("KEYSTORE_PASS")
25+
}
26+
}
1927
buildTypes {
2028
release {
2129
minifyEnabled false
2230
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
31+
signingConfig signingConfigs.config
2332
}
2433
}
34+
2535
}
2636
repositories {
2737
maven {

app/src/debug/AndroidManifest.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
package="com.junnanhao.next">
5+
<application
6+
android:name=".common.DebugApp"
7+
tools:replace="android:name"/>
8+
</manifest>
9+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.junnanhao.next.common
2+
3+
import com.facebook.stetho.Stetho
4+
import com.uphyca.stetho_realm.RealmInspectorModulesProvider
5+
6+
import timber.log.Timber
7+
8+
//import timber.log.Timber
9+
10+
11+
/**
12+
* Created by Jonas on 2017/5/28.
13+
* Custom Application
14+
*/
15+
class DebugApp : App() {
16+
override fun onCreate() {
17+
super.onCreate()
18+
initializeTimberDebug()
19+
initializeStethoDebug()
20+
}
21+
22+
fun initializeTimberDebug() {
23+
Timber.plant(Timber.DebugTree())
24+
}
25+
26+
fun initializeStethoDebug() {
27+
Stetho.initialize(
28+
Stetho.newInitializerBuilder(this)
29+
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
30+
.enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
31+
.build())
32+
}
33+
34+
}
35+

app/src/main/java/com/junnanhao/next/common/App.kt

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package com.junnanhao.next.common
22

33
import android.app.Application
4-
import com.facebook.stetho.Stetho
4+
import com.junnanhao.next.BuildConfig
55
import com.junnanhao.next.data.DaggerSongsRepositoryComponent
66
import com.junnanhao.next.data.SongsRepositoryComponent
77
import com.junnanhao.next.common.di.ApplicationModule
8-
import com.uphyca.stetho_realm.RealmInspectorModulesProvider
98
import io.realm.Realm
109
import io.realm.RealmConfiguration
11-
import timber.log.Timber
1210

1311
//import timber.log.Timber
1412

@@ -17,17 +15,13 @@ import timber.log.Timber
1715
* Created by Jonas on 2017/5/28.
1816
* Custom Application
1917
*/
20-
class App : Application() {
18+
open class App : Application() {
2119
override fun onCreate() {
2220
super.onCreate()
2321
initializeRealm()
2422
initializeDagger()
25-
initializeTimber()
2623
}
2724

28-
private fun initializeTimber() {
29-
Timber.plant(Timber.DebugTree())
30-
}
3125

3226
private fun initializeDagger() {
3327
songsRepositoryComponent = DaggerSongsRepositoryComponent
@@ -41,12 +35,6 @@ class App : Application() {
4135
val realmConfig = RealmConfiguration.Builder().build()
4236
// Realm.deleteRealm(realmConfig) // Delete Realm between app restarts.
4337
Realm.setDefaultConfiguration(realmConfig)
44-
45-
Stetho.initialize(
46-
Stetho.newInitializerBuilder(this)
47-
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
48-
.enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
49-
.build())
5038
}
5139

5240

gradle.properties

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)