Skip to content

Commit 8686941

Browse files
committed
Adjusted base project
1 parent b1f4574 commit 8686941

File tree

8 files changed

+106
-28
lines changed

8 files changed

+106
-28
lines changed

.circleci/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ jobs:
2929
name: Run Tests
3030
command: ./gradlew testDebug
3131

32+
- run:
33+
name: Check
34+
command: |
35+
if [ ! $CIRCLE_BRANCH = 'master' ]; then
36+
./gradlew --stacktrace lintDebug
37+
./gradlew --stacktrace ktlintDebugCheck
38+
fi
39+
3240
- store_artifacts:
3341
path: app/build/outputs
3442
destination: outputs

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
.externalNativeBuild
99

1010
# not ignore
11-
!.idea/codeStyleSettings.xml
11+
!.idea/codeStyleSettings.xml
12+
13+
fabric.properties

app/build.gradle

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
33
apply plugin: "org.jlleitschuh.gradle.ktlint"
4+
apply plugin: 'io.fabric'
5+
6+
def versionMajor = 0
7+
def versionMinor = 1
8+
def versionPatch = 0
49

510
android {
6-
compileSdkVersion 26
11+
compileSdkVersion versions.compileSdk
712
dataBinding.enabled = true
813

914
defaultConfig {
1015
applicationId "co.kyash.vtl"
11-
minSdkVersion 19
12-
targetSdkVersion 26
13-
versionCode 1
14-
versionName "1.0"
16+
minSdkVersion versions.minSdk
17+
targetSdkVersion versions.targetSdk
18+
versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch
19+
versionName "$versionMajor.$versionMinor.$versionPatch"
1520
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
21+
vectorDrawables.useSupportLibrary = true
22+
resConfigs "en", "ja"
1623
}
1724
buildTypes {
1825
debug {
@@ -37,18 +44,28 @@ android {
3744
}
3845

3946
dependencies {
40-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlinVersion"
41-
implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
42-
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
47+
//==================== Kotlin ====================
48+
implementation depends.kotlin.stdlib
49+
50+
//==================== Support Library ====================
51+
implementation depends.support.appcompat
4352

44-
testImplementation 'junit:junit:4.12'
45-
androidTestImplementation 'com.android.support.test:runner:1.0.1'
46-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
53+
//==================== Debug ====================
54+
implementation(depends.crashlytics) {
55+
transitive = true
56+
}
57+
58+
//==================== Test ====================
59+
testImplementation depends.junit
60+
testImplementation depends.mockitoKotlin
61+
testImplementation depends.robolectric.core
62+
androidTestImplementation depends.supporttest.runner
63+
androidTestImplementation depends.supporttest.espresso
4764
}
4865

4966
ktlint {
50-
version = "0.14.0"
67+
version = versions.ktlint
5168
android = true
5269
reporter = "checkstyle"
5370
ignoreFailures = true
54-
}
71+
}

app/src/main/AndroidManifest.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="co.kyash.vtl">
44

5+
<uses-permission android:name="android.permission.INTERNET" />
6+
57
<application
68
android:allowBackup="true"
79
android:icon="@mipmap/ic_launcher"
810
android:label="@string/app_name"
911
android:roundIcon="@mipmap/ic_launcher_round"
1012
android:supportsRtl="true"
1113
android:theme="@style/AppTheme">
14+
15+
<meta-data
16+
android:name="io.fabric.ApiKey"
17+
android:value="0a7aa1279a42a1b8dd1e111287030f783b9ee2d2" />
18+
1219
<activity android:name=".MainActivity">
1320
<intent-filter>
1421
<action android:name="android.intent.action.MAIN" />

app/src/main/java/co/kyash/vtl/MainActivity.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ package co.kyash.vtl
22

33
import android.os.Bundle
44
import android.support.v7.app.AppCompatActivity
5+
import com.crashlytics.android.Crashlytics
6+
import io.fabric.sdk.android.Fabric
7+
58

69
class MainActivity : AppCompatActivity() {
710

811
override fun onCreate(savedInstanceState: Bundle?) {
912
super.onCreate(savedInstanceState)
13+
Fabric.with(this, Crashlytics())
1014
setContentView(R.layout.activity_main)
1115
}
1216
}
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:app="http://schemas.android.com/apk/res-auto"
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
43
xmlns:tools="http://schemas.android.com/tools"
54
android:layout_width="match_parent"
65
android:layout_height="match_parent"
6+
android:orientation="vertical"
77
tools:context="co.kyash.vtl.MainActivity">
88

99
<TextView
1010
android:layout_width="wrap_content"
1111
android:layout_height="wrap_content"
12-
android:text="Hello World!"
13-
app:layout_constraintBottom_toBottomOf="parent"
14-
app:layout_constraintLeft_toLeftOf="parent"
15-
app:layout_constraintRight_toRightOf="parent"
16-
app:layout_constraintTop_toTopOf="parent" />
12+
android:layout_gravity="center"
13+
android:text="Hello World!" />
1714

18-
</android.support.constraint.ConstraintLayout>
15+
</LinearLayout>

build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
buildscript {
2-
3-
ext.kotlinVersion = '1.2.10'
4-
ext.supportLibraryVersion = '26.1.0'
2+
apply from: "${rootDir.absolutePath}/versions.gradle"
53

64
repositories {
75
google()
86
jcenter()
97
maven { url "https://plugins.gradle.org/m2/" }
8+
maven { url 'https://maven.fabric.io/public' }
109
}
1110
dependencies {
12-
classpath 'com.android.tools.build:gradle:3.0.1'
13-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
14-
classpath "gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:3.0.0"
11+
classpath "com.android.tools.build:gradle:$versions.gradleBuildTool"
12+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
13+
classpath "gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:$versions.ktlintGradle"
14+
classpath "io.fabric.tools:gradle:$versions.fabricGradleTool"
1515
}
1616
}
1717

versions.gradle

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
ext {
2+
versions = [
3+
compileSdk : 26,
4+
buildTools : "26.0.1",
5+
minSdk : 19,
6+
targetSdk : 26,
7+
gradleBuildTool : "3.0.1",
8+
kotlin : "1.2.10",
9+
ktlint : "0.14.0",
10+
ktlintGradle : "3.0.0",
11+
fabricGradleTool: "1.25.1",
12+
supportLibrary : "26.1.0",
13+
]
14+
15+
depends = [
16+
kotlin : [
17+
stdlib: "org.jetbrains.kotlin:kotlin-stdlib-jre7:$versions.kotlin",
18+
],
19+
20+
//==================== Support Library ====================
21+
support : [
22+
appcompat : "com.android.support:appcompat-v7:$versions.supportLibrary",
23+
design : "com.android.support:design:$versions.supportLibrary",
24+
cardview : "com.android.support:cardview-v7:$versions.supportLibrary",
25+
customtabs: "com.android.support:customtabs:$versions.supportLibrary",
26+
constraint: "com.android.support.constraint:constraint-layout:1.1.0-beta4",
27+
multidex : "com.android.support:multidex:1.0.2",
28+
],
29+
30+
crashlytics : "com.crashlytics.sdk.android:crashlytics:2.8.0@aar",
31+
32+
//==================== Test ====================
33+
junit : "junit:junit:4.12",
34+
mockitoKotlin: "com.nhaarman:mockito-kotlin:1.5.0",
35+
robolectric : [
36+
core: "org.robolectric:robolectric:3.5.1",
37+
],
38+
supporttest : [
39+
runner : "com.android.support.test:runner:1.0.1",
40+
espresso: "com.android.support.test.espresso:espresso-core:3.0.1"
41+
],
42+
]
43+
}

0 commit comments

Comments
 (0)