Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 618ce50

Browse files
committedMay 26, 2021
Release 3.7.2
1 parent 9540cd9 commit 618ce50

32 files changed

+564
-404
lines changed
 

‎app/build.gradle

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion 30
5-
buildToolsVersion '28.0.2'
65

76
defaultConfig {
87
applicationId "com.unity3d.ads.example"
98
minSdkVersion 19
109
targetSdkVersion 30
11-
versionCode = 3710
12-
versionName = "3.7.1"
10+
versionCode = 3720
11+
versionName = "3.7.2"
1312
}
1413

1514
flavorDimensions "arEnabled"

‎build.gradle

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
buildscript {
1+
allprojects {
32
repositories {
3+
google()
44
jcenter()
5+
}
6+
}
7+
8+
buildscript {
9+
repositories {
10+
jcenter()
11+
gradlePluginPortal()
512
google()
613
}
714

815
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.2.0'
10-
// NOTE: Do not place your application dependencies here; they belong
11-
// in the individual module build.gradle files
12-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
13-
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
16+
classpath 'com.android.tools.build:gradle:4.1.3'
1417
classpath 'org.jacoco:org.jacoco.core:0.8.1'
18+
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.20.0'
19+
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
1520
}
1621
}
1722

18-
allprojects {
19-
repositories {
20-
google()
21-
jcenter()
22-
}
23-
}
23+
apply from: 'nexusPublishing.gradle'

‎gradle.properties

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818
# org.gradle.parallel=true
19-
android.useAndroidX=true
19+
android.useAndroidX=true
20+
21+
signing.keyId=34500891
22+
signing.secretKeyRingFile=../gpg-private-key.gpg

‎gradle/wrapper/gradle-wrapper.jar

100644100755
File mode changed.
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu Aug 09 12:15:12 EEST 2018
1+
#Thu Apr 08 20:52:07 EDT 2021
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

‎unity-ads/artifactory.gradle

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apply plugin: 'com.jfrog.artifactory'
2+
3+
Properties properties = new Properties()
4+
if (project.rootProject.file('local.properties').exists()) {
5+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
6+
}
7+
8+
artifactory {
9+
contextUrl = 'https://unity3ddist.jfrog.io/artifactory'
10+
publish {
11+
repository {
12+
repoKey = properties.getProperty("artifactory.repokey")
13+
username = properties.getProperty("artifactory.username")
14+
password = properties.getProperty("artifactory.apikey")
15+
}
16+
defaults {
17+
// Tell the Artifactory Plugin which artifacts should be published to Artifactory.
18+
publications('release')
19+
}
20+
}
21+
}

‎unity-ads/build.gradle

+47-134
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,51 @@
1-
apply plugin: 'com.android.library'
2-
apply plugin: 'com.jfrog.bintray'
3-
apply plugin: 'com.github.dcendents.android-maven'
4-
apply plugin: 'jacoco'
5-
6-
ext {
7-
bintrayRepo = "UnityAds"
8-
bintrayName = "unityads"
9-
10-
publishedGroupId = 'com.unity3d.ads'
11-
libraryName = 'unity-ads'
12-
artifact = 'unity-ads'
13-
archivesBaseName = 'unity-ads'
1+
import com.android.ddmlib.DdmPreferences
142

15-
libraryDescription = 'Monetize your entire player base and reach new audiences with video ads.'
16-
17-
siteUrl = 'https://github.com/Unity-Technologies/unity-ads-android'
18-
gitUrl = 'https://github.com/Unity-Technologies/unity-ads-android.git'
19-
20-
libraryVersion = '3.7.1'
3+
apply plugin: 'com.android.library'
214

22-
developerId = 'sbankhead'
23-
developerName = 'Steven Bankhead'
24-
developerEmail = 'sbankhead@unity3d.com'
5+
Properties properties = new Properties()
6+
if (project.rootProject.file('local.properties').exists()) {
7+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
8+
}
259

26-
licenseName = 'Unity Ads License'
27-
licenseUrl = 'https://unity3d.com/legal/monetization-services-terms-of-service'
28-
allLicenses = ["Unity Ads License"]
10+
dependencies {
11+
testImplementation 'junit:junit:4.12'
12+
androidTestImplementation 'org.mockito:mockito-core:2.25.0'
13+
androidTestImplementation 'org.mockito:mockito-android:2.25.0'
14+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
15+
androidTestImplementation 'androidx.test:rules:1.1.1'
16+
compileOnly 'com.google.ar:core:1.0.0'
2917
}
3018

31-
version = libraryVersion
19+
ext {
20+
GROUP_ID = "com.unity3d.ads"
21+
ARTIFACT_ID = "unity-ads"
22+
VERSION_ID = "3.7.2"
23+
VERSION_CODE = 3720
24+
SIGN_AAR = properties.getProperty("SIGN_AAR") ?: false
25+
}
3226

3327
android {
3428
compileSdkVersion 30
35-
buildToolsVersion '28.0.2'
36-
com.android.ddmlib.DdmPreferences.setLogLevel("verbose")
37-
com.android.ddmlib.DdmPreferences.setTimeOut(10 * 60000)
29+
DdmPreferences.setLogLevel("verbose")
30+
DdmPreferences.setTimeOut(10 * 60000)
3831

3932
defaultPublishConfig "release"
4033

34+
lintOptions {
35+
abortOnError false
36+
}
37+
4138
defaultConfig {
4239
minSdkVersion 19
4340
targetSdkVersion 30
44-
/*
45-
Please ensure that the last two digits of version number does not exceed 50 unless
46-
it is a China SDK. This is because adding 50 to the version number is a one-to-one
47-
mapping between normal SDK and China SDK.
48-
49-
Example : version number 2350 corresponds to China version of 2300.
50-
51-
All SDK with version numbers with last two digits >= 50 will be treated
52-
as China SDK for filtering in the backend.
53-
*/
54-
versionCode = 3710
55-
versionName = "3.7.1"
41+
versionCode = VERSION_CODE
42+
versionName = VERSION_ID
5643

5744
setProperty("archivesBaseName", "unity-ads")
5845

5946
buildConfigField('String', 'WEBVIEW_BRANCH', getPropertyStringWithDefaultValue('WEBVIEW_BRANCH', '"' + versionName + '"'))
47+
buildConfigField('int', 'VERSION_CODE', "$versionCode")
48+
buildConfigField('String', 'VERSION_NAME', "\"$versionName\"")
6049
testBuildType "debug"
6150

6251
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
@@ -80,59 +69,43 @@ android {
8069
consumerProguardFiles 'proguard-rules.pro'
8170
}
8271
}
83-
84-
libraryVariants.all { variant ->
85-
variant.outputs.all { output ->
86-
if (outputFile != null && outputFileName.endsWith('.aar')) {
87-
outputFileName = "${archivesBaseName}-${variant.buildType.name}.aar"
88-
}
89-
}
90-
}
91-
92-
testVariants.all { variant ->
93-
variant.outputs.all { output ->
94-
outputFileName = "../../androidTest.apk"
95-
}
96-
}
97-
}
98-
99-
dependencies {
100-
testImplementation 'junit:junit:4.12'
101-
androidTestImplementation 'org.mockito:mockito-core:2.25.0'
102-
androidTestImplementation 'org.mockito:mockito-android:2.25.0'
103-
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
104-
androidTestImplementation 'androidx.test:rules:1.1.1'
105-
compileOnly 'com.google.ar:core:1.0.0'
10672
}
10773

108-
task javadoc(type: Javadoc, overwrite: true) {
74+
task javadoc(type: Javadoc) {
10975
description "Generates Javadoc for Release"
11076
source = android.sourceSets.main.java.srcDirs
11177
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
78+
ext.generatedClass = "build/generated/source/buildConfig/release/"
11279
doFirst {
113-
classpath = project.files(android.getBootClasspath().join(File.pathSeparator)) + files(ext.androidJar)
80+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
81+
classpath += files(ext.androidJar)
82+
classpath += fileTree(dir: 'libs', include: ['*.jar'])
83+
classpath += files(ext.generatedClass)
11484
}
11585
options {
11686
links "http://docs.oracle.com/javase/7/docs/api/"
117-
linksOffline "http://developer.android.com/reference","${android.sdkDirectory}/docs/reference"
11887
}
11988
exclude '**/R.java'
12089
exclude 'com/unity3d/services/ar/view/GLSurfaceView.java'
12190
exclude 'com/unity3d/services/ar/api/AR.java'
91+
exclude 'com/unity3d/services/ar/ARUtils.java'
92+
exclude 'com/unity3d/services/ar/configuration/ARModuleConfiguration.java'
12293
exclude 'com/unity3d/services/ar/view/ARView.java'
12394
exclude 'com/unity3d/services/ar/view/ARViewHandler.java'
95+
exclude 'com/unity3d/services/ar/view/BackgroundRenderer.java'
96+
exclude 'com/unity3d/services/ar/view/DisplayRotationHelper.java'
12497
destinationDir = file("../javadoc/")
12598
}
12699

127100
task androidJavadocsJar(type: Jar, dependsOn: javadoc) {
128-
classifier = "javadoc"
129-
baseName = "${archivesBaseName}"
101+
archiveClassifier.set("javadoc")
102+
archiveBaseName.set("${archivesBaseName}")
130103
from javadoc.destinationDir
131104
}
132105

133106
task androidSourcesJar(type: Jar) {
134-
classifier = "sources"
135-
baseName = "${archivesBaseName}"
107+
archiveClassifier.set("sources")
108+
archiveBaseName.set("${archivesBaseName}")
136109
from android.sourceSets.main.java.srcDirs
137110
}
138111

@@ -141,66 +114,6 @@ artifacts {
141114
archives androidSourcesJar
142115
}
143116

144-
jacoco {
145-
toolVersion = '0.8.1'
146-
}
147-
148-
tasks.withType(Test) {
149-
jacoco.includeNoLocationClasses = true
150-
}
151-
152-
task jacocoTestReport(type: JacocoReport) {
153-
reports {
154-
xml.enabled = true
155-
html.enabled = true
156-
}
157-
158-
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
159-
def javaClasses = fileTree(dir: "$project.buildDir/intermediates/classes/debug", excludes: fileFilter)
160-
def javaSrc = "$project.projectDir/src/main/java"
161-
162-
sourceDirectories = files([javaSrc])
163-
classDirectories = files([javaClasses])
164-
executionData = fileTree(dir: project.buildDir, includes: [
165-
'outputs/code-coverage/connected/*coverage.ec'
166-
])
167-
}
168-
169-
// Bintray
170-
task localProperties {
171-
if (!file("$rootDir/local.properties").exists()) {
172-
file("$rootDir/local.properties").withWriterAppend { w -> "" }
173-
}
174-
}
175-
176-
bintray {
177-
Properties properties = new Properties()
178-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
179-
180-
user = properties.getProperty("bintray.user")
181-
key = properties.getProperty("bintray.apikey")
182-
183-
configurations = ['archives']
184-
pkg {
185-
repo = bintrayRepo
186-
name = bintrayName
187-
desc = libraryDescription
188-
websiteUrl = siteUrl
189-
vcsUrl = gitUrl
190-
licenses = allLicenses
191-
publish = true
192-
publicDownloadNumbers = false
193-
version {
194-
desc = libraryDescription
195-
gpg {
196-
sign = true //Determines whether to GPG sign the files. The default is false
197-
passphrase = properties.getProperty("bintray.gpg.password")
198-
//Optional. The passphrase for GPG signing'
199-
}
200-
}
201-
}
202-
}
203-
204117
def getPropertyStringWithDefaultValue(String key, String defaultValue) {
205118
def value = project.getProperties().get(key)
206119
// Ensure that string is quoted
@@ -211,6 +124,6 @@ def getPropertyStringWithDefaultValue(String key, String defaultValue) {
211124
return value != null ? value : defaultValue
212125
}
213126

214-
if (project.rootProject.file('local.properties').exists()) {
215-
apply from: 'mavenPomBintrayUpload.gradle'
216-
}
127+
apply from: 'publishing.gradle'
128+
apply from: 'artifactory.gradle'
129+
apply from: 'jacoco.gradle'

‎unity-ads/jacoco.gradle

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apply plugin: 'jacoco'
2+
3+
jacoco {
4+
toolVersion = '0.8.1'
5+
}
6+
7+
tasks.withType(Test) {
8+
jacoco.includeNoLocationClasses = true
9+
}
10+
11+
task jacocoTestReport(type: JacocoReport) {
12+
reports {
13+
xml.enabled = true
14+
html.enabled = true
15+
}
16+
17+
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
18+
def javaClasses = fileTree(dir: "$project.buildDir/intermediates/classes/debug", excludes: fileFilter)
19+
def javaSrc = "$project.projectDir/src/main/java"
20+
21+
sourceDirectories.setFrom(files([javaSrc]))
22+
classDirectories.setFrom(files([javaClasses]))
23+
executionData.setFrom(fileTree(dir: project.buildDir, includes: [
24+
'outputs/code-coverage/connected/*coverage.ec'
25+
]))
26+
}

0 commit comments

Comments
 (0)
Please sign in to comment.