1
1
import com.android.ddmlib.DdmPreferences
2
2
3
3
apply plugin : ' com.android.library'
4
+ apply plugin : ' kotlin-android'
5
+ apply from : ' ../dokka.gradle'
4
6
5
7
Properties properties = new Properties ()
6
8
if (project. rootProject. file(' local.properties' ). exists()) {
@@ -10,8 +12,8 @@ if (project.rootProject.file('local.properties').exists()) {
10
12
ext {
11
13
GROUP_ID = " com.unity3d.ads"
12
14
ARTIFACT_ID = " unity-ads"
13
- VERSION_ID = " 4.4.1 "
14
- VERSION_CODE = 4410
15
+ VERSION_ID = " 4.5.0 "
16
+ VERSION_CODE = 4500
15
17
SIGN_AAR = properties. getProperty(" SIGN_AAR" ) ?: false
16
18
}
17
19
@@ -49,6 +51,27 @@ android {
49
51
targetCompatibility JavaVersion . VERSION_1_7
50
52
}
51
53
54
+ tasks. withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ). configureEach {
55
+ if (it. name. contains(" UnitTest" )) {
56
+ sourceCompatibility = JavaVersion . VERSION_1_8
57
+ targetCompatibility = JavaVersion . VERSION_1_8
58
+ kotlinOptions {
59
+ jvmTarget = " 1.8"
60
+ }
61
+ } else {
62
+ sourceCompatibility = JavaVersion . VERSION_1_6
63
+ targetCompatibility = JavaVersion . VERSION_1_6
64
+ kotlinOptions {
65
+ jvmTarget = " 1.6"
66
+ }
67
+ }
68
+ kotlinOptions {
69
+ apiVersion = " 1.4"
70
+ languageVersion = " 1.4"
71
+ freeCompilerArgs = freeCompilerArgs + " -Xopt-in=kotlin.RequiresOptIn" + " -Xallow-result-return-type"
72
+ }
73
+ }
74
+
52
75
buildTypes {
53
76
release {
54
77
minifyEnabled false
@@ -65,6 +88,9 @@ android {
65
88
66
89
dependencies {
67
90
implementation fileTree(dir : ' libs' , include : [' *.jar' ])
91
+ implementation " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
92
+ implementation " org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version "
93
+ androidTestCompileOnly project(' :unity-scaradapter-2100' )
68
94
androidTestCompileOnly project(' :unity-scaradapter-2000' )
69
95
androidTestCompileOnly project(' :unity-scaradapter-1950' )
70
96
androidTestCompileOnly project(' :unity-scaradapter-1920' )
@@ -80,37 +106,20 @@ dependencies {
80
106
androidTestImplementation ' com.google.android.gms:play-services-ads:19.5.0'
81
107
androidTestImplementation ' com.android.billingclient:billing:4.0.0'
82
108
compileOnly ' com.google.ar:core:1.0.0'
109
+ compileOnly project(' :unity-scaradapter-2100' )
83
110
compileOnly project(' :unity-scaradapter-2000' )
84
111
compileOnly project(' :unity-scaradapter-1950' )
85
112
compileOnly project(' :unity-scaradapter-1920' )
86
113
compileOnly project(' :unity-scaradapter-common' )
87
114
testImplementation ' junit:junit:4.13.2'
115
+ testImplementation " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
116
+ testImplementation " org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version "
117
+ testImplementation " org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version "
118
+ testImplementation " org.mockito.kotlin:mockito-kotlin:4.0.0"
88
119
testImplementation ' org.mockito:mockito-core:2.28.2'
89
120
testImplementation ' com.android.billingclient:billing:4.0.0'
90
- }
91
-
92
- task javadoc (type : Javadoc ) {
93
- description " Generates Javadoc for Release"
94
- source = android. sourceSets. main. java. srcDirs
95
- ext. androidJar = " ${ android.sdkDirectory} /platforms/${ android.compileSdkVersion} /android.jar"
96
- ext. generatedClass = " build/generated/source/buildConfig/release/"
97
- doFirst {
98
- classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
99
- classpath + = files(ext. androidJar)
100
- classpath + = fileTree(dir : ' libs' , include : [' *.jar' ])
101
- classpath + = files(ext. generatedClass)
102
- }
103
- options {
104
- links " http://docs.oracle.com/javase/7/docs/api/"
105
- }
106
- exclude ' **/R.java'
107
- destinationDir = file(" ../javadoc/" )
108
- }
109
-
110
- task androidJavadocsJar (type : Jar , dependsOn : javadoc) {
111
- archiveClassifier. set(" javadoc" )
112
- archiveBaseName. set(" ${ archivesBaseName} " )
113
- from javadoc. destinationDir
121
+ testImplementation " io.mockk:mockk:1.11.0"
122
+ testImplementation ' org.json:json:20180813'
114
123
}
115
124
116
125
task androidSourcesJar (type : Jar ) {
@@ -119,9 +128,15 @@ task androidSourcesJar(type: Jar) {
119
128
from android. sourceSets. main. java. srcDirs
120
129
}
121
130
131
+ task androidJavadocsJar (type : Jar , dependsOn : dokkaJavadoc) {
132
+ archiveClassifier. set(" javadoc" )
133
+ archiveBaseName. set(" ${ archivesBaseName} " )
134
+ from " $rootDir /../javadoc/"
135
+ }
136
+
122
137
artifacts {
123
- archives androidJavadocsJar
124
138
archives androidSourcesJar
139
+ archives androidJavadocsJar
125
140
}
126
141
127
142
def getPropertyStringWithDefaultValue (String key , String defaultValue ) {
0 commit comments