redrield
06/18/2017, 1:36 PMjk
06/18/2017, 5:00 PMnhaarman
06/21/2017, 12:27 PMnatpryce
06/22/2017, 12:34 PMjackmiras
06/26/2017, 3:43 PMbuildscript {
ext.kotlin_version = '1.1.3'
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-M4'
}
}
allprojects {
repositories {
jcenter()
maven { url "<https://jitpack.io>" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My app/build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'org.junit.platform.gradle.plugin'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.myappid"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), '<http://proguard-rules.pro|proguard-rules.pro>'
}
}
}
def retrofit_version = '2.3.0'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile "com.squareup.retrofit2:retrofit:${retrofit_version}"
compile "com.squareup.retrofit2:converter-jackson:${retrofit_version}"
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
compile 'io.paperdb:paperdb:2.0'
compile 'com.mobsandgeeks:android-saripaar:2.0.3'
compile 'com.github.jackmiras:logger:1.2'
compile 'com.github.jackmiras:placeholderj:2.3.0'
}
When I try to sync those scripts I'm getting the following error:
Error:The 'java' plugin has been applied, but it is not compatible with the Android plugins.
Does anyone know how to solve this?raniejade
06/26/2017, 4:04 PMjackmiras
06/27/2017, 1:52 AMcodeslubber
06/27/2017, 4:50 PMjk
06/27/2017, 5:02 PMjk
06/27/2017, 5:02 PMcmd-shift-a
and type in toggle parameter hint
to disable itjk
06/27/2017, 5:04 PMEditor - General - Appearance - Show parameter name hints
codeslubber
06/27/2017, 5:04 PMcodeslubber
06/27/2017, 5:04 PMcodeslubber
06/27/2017, 5:04 PMjk
06/27/2017, 5:05 PMcodeslubber
06/27/2017, 5:06 PMPasted image at 2017-06-27, 10:06 AM▾
jk
06/27/2017, 5:08 PMcodeslubber
06/27/2017, 5:09 PMrobfletcher
06/29/2017, 8:39 PMrobfletcher
06/29/2017, 8:41 PMrobfletcher
06/29/2017, 8:41 PMjk
06/29/2017, 8:42 PMIan
07/06/2017, 2:52 AMJul 05, 2017 9:50:39 PM org.junit.platform.launcher.core.ServiceLoaderTestEngineRegistry loadTestEngines
INFO: Discovered TestEngines with IDs: [spek]
Exception in thread "main" java.lang.AbstractMethodError: Method org/jetbrains/spek/engine/Scope$Group.isTest()Z is abstract
at org.jetbrains.spek.engine.Scope$Group.isTest(Scope.kt)
at org.junit.platform.engine.TestDescriptor.hasTests(TestDescriptor.java:160)
at org.junit.platform.launcher.core.Root.lambda$static$0(Root.java:33)
at org.junit.platform.launcher.core.Root$$Lambda$18/1562557367.visit(Unknown Source)
at org.junit.platform.engine.TestDescriptor.accept(TestDescriptor.java:179)
at org.junit.platform.engine.TestDescriptor.lambda$accept$0(TestDescriptor.java:181)
at org.junit.platform.engine.TestDescriptor$$Lambda$32/534906248.accept(Unknown Source)
at java.lang.Iterable.forEach(Iterable.java:75)
at org.junit.platform.engine.TestDescriptor.accept(TestDescriptor.java:181)
at org.junit.platform.launcher.core.Root.lambda$acceptInAllTestEngines$2(Root.java:85)
at org.junit.platform.launcher.core.Root$$Lambda$31/1997963191.accept(Unknown Source)
at java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:600)
at org.junit.platform.launcher.core.Root.acceptInAllTestEngines(Root.java:85)
at org.junit.platform.launcher.core.Root.prune(Root.java:77)
at org.junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:117)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85)
at org.jetbrains.spek.tooling.runner.junit.JUnitPlatformSpekRunner.run(JUnitPlatformSpekRunner.kt:107)
at org.jetbrains.spek.tooling.MainKt.main(Main.kt:58)
Ian
07/06/2017, 2:52 AMpatjackson52
07/10/2017, 7:45 PMpatjackson52
07/10/2017, 8:22 PMcoderant
07/17/2017, 1:52 AMdsgryazin
07/18/2017, 4:17 PMhttps://medium.com/@jozemberi/developing-with-kotlin-and-testing-with-spek-d69a94857d
https://blacklenspub.com/bacon-driven-development-in-kotlin-with-spek-376780e7ab3ahere in chat I saw an advice to use https://github.com/aurae/android-junit5 Is there any official way to use Spek on android projects (plain unit tests only) ?
adambl4
07/18/2017, 4:22 PMaurae/android-junit5
and ./gradlew junitPlatformTest
artem_zin
07/20/2017, 5:14 AM