Skip to content
This repository was archived by the owner on Aug 15, 2021. It is now read-only.

Commit fe44d75

Browse files
committed
2019-12-21 Version 2.1.0: Added Travis CI and detekt implementation
1 parent df958ce commit fe44d75

28 files changed

+422
-29
lines changed

.travis.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
language: android
2+
dist: trusty
3+
sudo: false
4+
5+
android:
6+
components:
7+
- tools
8+
- platform-tools
9+
- build-tools-29.0.2
10+
- android-29
11+
- android-22
12+
- extra-android-m2repository
13+
- extra-android-support
14+
- extra-google-m2repository
15+
- extra-google-google_play_services
16+
- sys-img-armeabi-v7a-android-22
17+
18+
jdk:
19+
- oraclejdk8
20+
21+
before_install:
22+
- yes | sdkmanager "build-tools;29.0.2"
23+
- chmod +x gradlew
24+
25+
script:
26+
- ./gradlew detekt
27+
- echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a
28+
- emulator -avd test -no-skin -no-audio -no-window &
29+
- android-wait-for-emulator
30+
- adb shell input keyevent 82 &
31+
- ./gradlew connectedAndroidTest

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Random Notes
44
=======================
55

6+
![Travis CI](https://img.shields.io/travis/fartem/parse-android-test-app?style=flat-square)
67
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-site-brightgreen?style=flat-square)](https://android-arsenal.com/details/3/7906)
78
![Open issues](https://img.shields.io/github/issues-raw/fartem/parse-android-test-app.svg?color=ff534a&style=flat-square)
89

app/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-android-extensions'
4+
apply plugin: 'io.gitlab.arturbosch.detekt'
45

56
android {
67
compileSdkVersion 29
@@ -19,8 +20,12 @@ android {
1920
}
2021
}
2122

23+
detekt {
24+
config = files("$rootDir/detekt-config.yml")
25+
filters = ".*build.*,.*/resources/.*,.*/tmp/.*,*.java"
26+
}
27+
2228
dependencies {
23-
implementation fileTree(dir: 'libs', include: ['*.jar'])
2429
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
2530
implementation 'androidx.appcompat:appcompat:1.1.0'
2631
implementation 'androidx.core:core-ktx:1.1.0'

app/src/main/java/com/smlnskgmail/jaman/randomnotes/Application.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ class Application : Application() {
2121
super.onTerminate()
2222
}
2323

24-
}
24+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/components/BaseBottomSheet.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ abstract class BaseBottomSheet : BottomSheetDialogFragment() {
2121

2222
abstract fun getLayoutResId(): Int
2323

24-
}
24+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/components/BaseDialog.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ abstract class BaseDialog(context: Context) : Dialog(context) {
2121

2222
abstract fun getLayoutResId(): Int
2323

24-
}
24+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/components/BaseFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ interface FragmentResume {
7070

7171
fun onFragmentResume()
7272

73-
}
73+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/components/LongToast.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ class LongToast(
1616
).show()
1717
}
1818

19-
}
19+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/logic/invite/InviteCallback.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ interface InviteCallback {
44

55
fun onInviteAction(success: Boolean)
66

7-
}
7+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/logic/invite/InviteDialog.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ class InviteDialog(context: Context) : BaseDialog(context) {
3838

3939
override fun getLayoutResId() = R.layout.dialog_invite
4040

41-
}
41+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/logic/login/LoginFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ class LoginFragment : BaseFragment() {
8181

8282
override fun showMenuInToolbar() = false
8383

84-
}
84+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/logic/main/MainFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,4 @@ class MainFragment : BaseFragment(), AddNoteBottomSheet.AddNoteTarget, InviteCal
165165

166166
override fun getToolbarMenuResId() = R.menu.menu_main
167167

168-
}
168+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/logic/main/noteslist/NoteDeleteListener.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ interface NoteDeleteListener {
44

55
fun onNoteDelete(position: Int)
66

7-
}
7+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/logic/main/noteslist/NotesAdapter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ class NotesAdapter(private val notes: MutableList<Note>)
3030

3131
override fun getItemCount() = notes.size
3232

33-
}
33+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/logic/main/noteslist/NotesHolder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ class NotesHolder(
2020
}
2121
}
2222

23-
}
23+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/logic/notecreation/AddNoteBottomSheet.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ class AddNoteBottomSheet : BaseBottomSheet() {
4141

4242
}
4343

44-
}
44+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/logic/sources/ormlite/OrmLiteDataSource.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ import com.smlnskgmail.jaman.randomnotes.repository.model.local.LocalDataSource
1212
import com.smlnskgmail.jaman.randomnotes.tools.L
1313
import java.sql.SQLException
1414

15-
private const val databaseFileName = "rn.db"
16-
17-
private const val databaseVersion1 = 1
18-
19-
private const val currentDatabaseVersion = databaseVersion1
20-
2115
class OrmLiteDataSource(
2216
private var context: Context
2317
) : OrmLiteSqliteOpenHelper(
@@ -30,6 +24,12 @@ class OrmLiteDataSource(
3024

3125
companion object {
3226

27+
private const val databaseFileName = "rn.db"
28+
29+
private const val databaseVersion1 = 1
30+
31+
private const val currentDatabaseVersion = databaseVersion1
32+
3333
val databaseEntities = arrayOf<Class<*>>(
3434
Note::class.java
3535
)
@@ -103,4 +103,4 @@ class OrmLiteDataSource(
103103
OpenHelperManager.releaseHelper()
104104
}
105105

106-
}
106+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/logic/sources/parse/ParseDataSource.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,4 @@ class ParseDataSource(
177177
}
178178
}
179179

180-
}
180+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/repository/DataRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ class DataRepository(
7575
localDataSource.delete(note)
7676
}
7777

78-
}
78+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/repository/DataRepositoryAccessor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ object DataRepositoryAccessor {
2222
dataRepository.destroy()
2323
}
2424

25-
}
25+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/repository/entities/EntityWitId.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ abstract class EntityWitId(
77
@DatabaseField(generatedId = true)
88
var id: Long = -1
99

10-
)
10+
)

app/src/main/java/com/smlnskgmail/jaman/randomnotes/repository/entities/Note.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ class Note(
3535
return result
3636
}
3737

38-
}
38+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/repository/model/cloud/CloudDataSource.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ interface CloudDataSource {
4040

4141
fun logOut(afterLogOut: (e: Exception?) -> Unit)
4242

43-
}
43+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/repository/model/local/LocalDataSource.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ interface LocalDataSource {
1313

1414
fun destroy()
1515

16-
}
16+
}

app/src/main/java/com/smlnskgmail/jaman/randomnotes/tools/L.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ object L {
1212
)
1313
}
1414

15-
}
15+
}

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ buildscript {
1111
}
1212
}
1313

14+
plugins {
15+
id "io.gitlab.arturbosch.detekt" version "1.2.2"
16+
}
17+
1418
allprojects {
1519
repositories {
1620
google()

0 commit comments

Comments
 (0)