-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
88 lines (76 loc) · 2.66 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
* This build file was created to target Android Studio Flamingo using gradle jdk 17
* and gradle version 7.6.1
*
* If you are experiencing build issues try checking/setting the gradle jdk on
* preferences -> Build, Execution, Deployment -> Build Tools -> Gradle -> Gradle JDK
*
* The gradle version should be automatically set, but if that is failing you can manually
* set it on /gradle/wrapper/gradle-wrapper.properties file setting the version to 7.6.1
*
* If you are still experiencing build issues with the expected config try seeking help on
* android channel at hyperskill users discord server (https://discord.gg/ut6nEqu)
*/
buildscript {
apply plugin: 'hyperskill'
wrapper {
gradleVersion = hs.android.gradleVersion
}
def kotlinGradleVersion = hs.android.kotlinGradleVersion
def androidGradleVersion = hs.android.getAndroidGradleVersion(gradle.gradleVersion)
repositories {
google()
mavenCentral()
maven { url 'https://packages.jetbrains.team/maven/p/hyperskill-hs-test/maven' }
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.github.hyperskill:hs-gradle-plugin:release-SNAPSHOT'
classpath "com.android.tools.build:gradle:$androidGradleVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinGradleVersion"
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
}
allprojects {
apply plugin: 'hyperskill'
repositories {
google()
mavenCentral()
}
afterEvaluate {
if (extensions.findByName('android') != null) {
android {
testOptions {
unitTests {
includeAndroidResources = true
all {
afterTest { TestDescriptor test, TestResult result ->
if (result.resultType == TestResult.ResultType.FAILURE) {
def message = result.exception?.message ?: "Wrong answer"
def lines = message.readLines()
println "#educational_plugin FAILED + " + lines[0]
lines.subList(1, lines.size()).forEach { line ->
println "#educational_plugin" + line
}
// we need this to separate output of different tests
println()
}
}
}
}
}
defaultConfig {
testInstrumentationRunner 'com.edu.AndroidEduTestRunner'
}
}
dependencies {
def robolectric = hs.android.robolectricVersion
testImplementation "org.robolectric:robolectric:$robolectric"
def junit = hs.android.lib.junit
testImplementation "junit:junit:$junit"
}
}
}
}