Skip to content

Commit 3130602

Browse files
committed
Revert ":see_no_evil: i just want to build core"
This reverts commit 170dfb0.
1 parent 1967849 commit 3130602

File tree

4 files changed

+115
-5
lines changed

4 files changed

+115
-5
lines changed

android/build.gradle

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
plugins {
2+
id 'com.android.library'
3+
id 'kotlin-android'
4+
id 'org.jetbrains.kotlin.plugin.serialization'
5+
id 'de.mannodermaus.android-junit5'
6+
}
7+
8+
android {
9+
compileSdkVersion 33
10+
11+
defaultConfig {
12+
// Required when setting minSdkVersion to 20 or lower
13+
multiDexEnabled true
14+
15+
minSdkVersion 16
16+
targetSdkVersion 33
17+
versionCode VERSION_CODE.toInteger()
18+
versionName VERSION_NAME
19+
20+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
21+
consumerProguardFiles "consumer-rules.pro"
22+
23+
buildConfigField("int", "SEGMENT_VERSION_CODE", "${versionCode}")
24+
buildConfigField("String", "SEGMENT_VERSION_NAME", "\"${versionName}\"")
25+
}
26+
27+
buildTypes {
28+
release {
29+
minifyEnabled false
30+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
31+
}
32+
}
33+
compileOptions {
34+
sourceCompatibility JavaVersion.VERSION_1_8
35+
targetCompatibility JavaVersion.VERSION_1_8
36+
}
37+
kotlinOptions {
38+
jvmTarget = '1.8'
39+
}
40+
testOptions {
41+
unitTests {
42+
includeAndroidResources = true
43+
}
44+
}
45+
46+
}
47+
48+
dependencies {
49+
// MAIN DEPS
50+
api project(':core')
51+
api 'com.segment:sovran-kotlin:1.2.2'
52+
api "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1"
53+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1'
54+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1'
55+
implementation 'androidx.lifecycle:lifecycle-process:2.6.1'
56+
implementation 'androidx.lifecycle:lifecycle-common-java8:2.6.1'
57+
58+
59+
// TESTING
60+
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
61+
testImplementation 'io.mockk:mockk:1.12.2'
62+
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.1'
63+
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
64+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
65+
66+
// Add JUnit5 dependencies.
67+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
68+
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
69+
70+
// Add JUnit4 legacy dependencies.
71+
testImplementation 'junit:junit:4.13.2'
72+
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.8.2'
73+
74+
// Add Roboelectric dependencies.
75+
testImplementation 'org.robolectric:robolectric:4.7.3'
76+
testImplementation 'androidx.test:core:1.5.0'
77+
}
78+
79+
apply from: rootProject.file('gradle/artifacts-android.gradle')
80+
apply from: rootProject.file('gradle/mvn-publish.gradle')
81+
apply from: rootProject.file('gradle/codecov.gradle')

gradle/artifacts-android.gradle

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
task sourcesJar(type: Jar) {
2+
archiveClassifier.set('sources')
3+
from android.sourceSets.main.java.srcDirs
4+
}
5+
6+
task javadoc(type: Javadoc) {
7+
configurations.implementation.setCanBeResolved(true)
8+
9+
failOnError false
10+
source = android.sourceSets.main.java.sourceFiles
11+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
12+
classpath += configurations.implementation
13+
}
14+
15+
// build a jar with javadoc
16+
task javadocJar(type: Jar, dependsOn: javadoc) {
17+
archiveClassifier.set('javadoc')
18+
from javadoc.destinationDir
19+
}
20+
21+
// Attach Javadocs and Sources jar
22+
artifacts {
23+
archives sourcesJar
24+
archives javadocJar
25+
}

gradle/codecov.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ task codeCoverageReport(type: JacocoReport) {
2929
executionData.setFrom(execData)
3030

3131
reports {
32-
xml.required.set(true)
32+
xml.enabled true
3333
xml.destination file("${buildDir}/reports/jacoco/report.xml")
34-
html.required.set(true)
35-
csv.required.set(true)
34+
html.enabled true
35+
csv.enabled false
3636
}
3737
}

gradle/mvn-publish.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'maven-publish'
2+
apply plugin: 'signing'
23

34
publishing {
45
publications {
@@ -74,7 +75,10 @@ publishing {
7475
}
7576

7677

78+
signing {
79+
sign publishing.publications
80+
}
81+
7782
publish.dependsOn build
7883
publishToMavenLocal.dependsOn build
79-
publishReleasePublicationToMavenLocal.dependsOn jar
80-
publishToSonatype.dependsOn publish
84+
publishToSonatype.dependsOn publish

0 commit comments

Comments
 (0)