-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle
137 lines (115 loc) · 4.22 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.android_tools = '7.1.0'
ext.kotlin_version = '1.6.20'
ext.android_junit5_version = '1.8.2.0'
ext.junit5 = '5.8.2'
ext.assertj_version = '3.22.0'
ext.mockk_version = '1.12.3'
ext.gradle_maven_publish = '0.19.0'
ext.purchases_version = '5.6.0'
ext.billing_unityiap_purchases_version = '3.0.3'
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:$android_tools"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "de.mannodermaus.gradle.plugins:android-junit5:$android_junit5_version"
classpath "com.vanniktech:gradle-maven-publish-plugin:$gradle_maven_publish"
}
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: "de.mannodermaus.android-junit5"
def artifactId = project.property("POM_ARTIFACT_ID")
def publishVariant = project.property("PUBLISH_VARIANT")
if (publishVariant == "unityIAPRelease") {
project.ext.POM_ARTIFACT_ID = artifactId + "-unityiap"
}
apply plugin: "com.vanniktech.maven.publish"
mavenPublish {
androidVariantToPublish = project.property("PUBLISH_VARIANT")
}
android {
compileSdkVersion 32
buildToolsVersion "32.0.0"
defaultConfig {
minSdkVersion 14
targetSdkVersion 32
versionCode 1
versionName "4.2.0"
consumerProguardFiles 'consumer-rules.pro'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
// Add Kotlin source directory to all source sets
sourceSets.each {
it.java.srcDirs += "src/$it.name/kotlin"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
flavorDimensions "dependencyVersions"
productFlavors {
unityIAP {
dimension "dependencyVersions"
}
latestDependencies {
dimension "dependencyVersions"
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.annotation:annotation:1.3.0'
latestDependenciesApi "com.revenuecat.purchases:purchases:$purchases_version"
latestDependenciesApi "com.revenuecat.purchases:purchases-core-common:$purchases_version"
latestDependenciesApi "com.revenuecat.purchases:purchases-core-utils:$purchases_version"
latestDependenciesApi "com.revenuecat.purchases:purchases-store-amazon:$purchases_version"
unityIAPApi "com.revenuecat.purchases:purchases-unityiap:$purchases_version"
unityIAPApi "com.revenuecat.purchases:purchases-core-common-unityiap:$purchases_version"
unityIAPApi "com.revenuecat.purchases:purchases-core-utils-unityiap:$purchases_version"
unityIAPApi "com.revenuecat.purchases:purchases-store-amazon-unityiap:$purchases_version"
testUnityIAPImplementation "com.android.billingclient:billing:$billing_unityiap_purchases_version"
// assertion
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testImplementation "org.assertj:assertj-core:$assertj_version"
testImplementation "io.mockk:mockk:$mockk_version"
testImplementation "com.revenuecat.purchases:purchases-store-google:$purchases_version"
// junit 5
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2")
}
repositories {
google()
mavenCentral()
}
// Call passing parameter -PpurchasesPath="$HOME/Development/repos/purchases-android"
task enableLocalBuild {
group = 'Tools'
description = 'Enable composite build'
doLast {
new File(".composite-enable").text = purchasesPath
}
}
task disableLocalBuild {
group = 'Tools'
description = 'Disable composite build'
doLast {
File file = file(".composite-enable")
if (file.exists()) {
file.delete()
}
}
}