Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support travis ci #169

Merged
merged 15 commits into from
Feb 13, 2019
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
25 changes: 19 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,29 @@ captures/

# Intellij
*.iml

.idea/caches/
.idea/libraries/
.idea/shelf/
.idea/workspace.xml
.idea/tasks.xml
.idea/libraries
.idea/vcs.xml
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/misc.xml
.idea/modules.xml
.idea/markdown-navigator/
.idea/markdown-navigator.xml
.idea/codeStyleSettings.xml
.idea/markdown-exported-files.xml
.idea/scopes/scope_settings.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml
.idea/datasources.xml
.idea/dataSources.ids
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
.idea/assetWizardSettings.xml
.idea/codeStyles/*

projectFilesBackup/

Expand Down
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

22 changes: 0 additions & 22 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/dictionaries/nakayama.xml

This file was deleted.

20 changes: 0 additions & 20 deletions .idea/gradle.xml

This file was deleted.

41 changes: 41 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
language: android

env:
global:
- GRADLE_OPTS="-Xmx512m -XX:MaxPermSize=512m"
- ADB_INSTALL_TIMEOUT=10

android:
components:
- build-tools-28.0.3
- android-28
- android-22
- extra-google-m2repository
- extra-android-m2repository
- addon-google_apis-google-28
- sys-img-armeabi-v7a-android-22

licenses:
- android-sdk-preview-license-.+
- android-sdk-license-.+
- google-gdk-license-.+

branches:
only:
- master

before_install:
- yes | sdkmanager "platforms;android-28"
- 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:
- echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a
- QEMU_AUDIO_DRV=none emulator -avd test -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &

script:
- ./gradlew clean lint test :example:connectedAndroidTest
13 changes: 8 additions & 5 deletions chatmessageview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def libVersion = properties.getProperty('version')
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
testOptions.unitTests.includeAndroidResources = true

defaultConfig {
minSdkVersion 15
Expand Down Expand Up @@ -112,11 +113,13 @@ dependencies {
implementation "androidx.core:core:1.0.1"
implementation "androidx.appcompat:appcompat:1.0.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

implementation 'de.hdodenhof:circleimageview:3.0.0'

testImplementation 'junit:junit:4.12'
implementation "de.hdodenhof:circleimageview:3.0.0"
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "com.android.support:support-v4:28.0.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation "junit:junit:4.12"
testImplementation "org.robolectric:robolectric:4.1"
testImplementation "androidx.test:core:1.1.0"
testImplementation "org.mockito:mockito-core:2.24.0"
}

Expand Down Expand Up @@ -144,7 +147,7 @@ artifacts {
archives sourcesJar
}

task findConventions << {
task findConventions doLast {
println project.getConvention()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object TimeUtils {
*/
@SuppressLint("SimpleDateFormat")
fun calendarToString(calendar: Calendar, format: String?): String {
val sdf = SimpleDateFormat( format ?: "HH:mm")
val sdf = SimpleDateFormat( format ?: "HH:mm", Locale.ENGLISH)
return sdf.format(calendar.time)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class DateFormatterTest {
val formatter = DateFormatter()
val calendar = Calendar.getInstance()
calendar.set(2017, 10, 12)
assertEquals(formatter.getFormattedTimeText(calendar), "Nov. 12, 2017")
assertEquals("Nov. 12, 2017", formatter.getFormattedTimeText(calendar))
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.content.Context
import android.graphics.BitmapFactory
import android.view.View
import android.widget.TextView

import androidx.test.core.app.ApplicationProvider
import com.github.bassaer.chatmessageview.R
import com.github.bassaer.chatmessageview.model.Attribute
import com.github.bassaer.chatmessageview.model.ChatUser
Expand All @@ -16,7 +16,6 @@ import org.junit.Test
import org.junit.runner.RunWith

import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment

/**
* MessageAdapter Unit Test
Expand All @@ -30,7 +29,7 @@ internal class MessageAdapterTest {

@Before
fun setUp() {
context = RuntimeEnvironment.application
context = ApplicationProvider.getApplicationContext()
messageList = ArrayList()
val senderIcon = BitmapFactory.decodeResource(context.resources, R.drawable.ic_account_circle)
val receiverIcon = BitmapFactory.decodeResource(context.resources, R.drawable.ic_action_user)
Expand Down
9 changes: 2 additions & 7 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,14 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':chatmessageview')
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.appcompat:appcompat:1.0.2"
implementation 'com.google.code.gson:gson:2.8.5'

testImplementation 'junit:junit:4.12'

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.code.gson:gson:2.8.2'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation "androidx.test.espresso:espresso-core:3.1.1"
androidTestImplementation "androidx.test.espresso:espresso-idling-resource:3.1.1"
androidTestImplementation "androidx.test:rules:1.1.1"
androidTestImplementation "androidx.test:runner:1.1.1"
androidTestImplementation "androidx.test.ext:junit:1.1.0"

}

repositories {
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
android.enableUnitTestBinaryResources=true