-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
106 lines (94 loc) · 3.58 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
/*
* Copyright 2020 Criteo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
gradlePluginPortal()
google()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21"
classpath "com.banno.gordon:gordon-plugin:1.8.6"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.0.0"
}
allprojects {
repositories {
google()
mavenCentral()
maven {
setUrl("https://oss.sonatype.org/content/repositories/snapshots/")
}
}
}
// Share publication configuration for subProjects
ext {
/**
* Current adapter version
*
* The three first digits correspond to the version of the PublisherSDK that is linked to this adapter.
* The last digit is an incremental version of this adapter for this PublisherSDK version.
*
* This means, that every time a new PublisherSDK is deployed (version A.B.C), then a new adapter should be
* deployed as well with version A.B.C.0. If fixes, or updates are required on the adapter without updating
* the SDK, then the last digit is incremented to produce A.B.C.1, then A.B.C.2, ...
*/
adapter_version = "7.1.0.0"
isSnapshot = properties["isRelease"] != "true"
def timestamp = new Date().format("yyyyMMdd.HHmm")
adapter_publication_version = ext.isSnapshot
? "${ext.adapter_version}-$timestamp"
: ext.adapter_version
def adapter_version_tokens = ext.adapter_version.tokenize('.')
sdk_version = adapter_version_tokens[0..-2].join('.')
/**
* Compute a dynamic version range for development SDK
*
* Development SDKs are published for every commit on the main branch. The version has this
* format: A.B.C-yyyyMMdd.HHmm. Hence an adapter with the version A.B.C.D should rely on the
* latest dev SDK between A.B.C (included) and A.B.C+1 (excluded).
*
* This is achieved by using the [A.B.C, A.B.C+1[ notation.
* Note that, using A.B.C+ is sufficient but, Maven Central does not accept such dynamic
* version.
*/
def sdk_next_version_tokens = adapter_version_tokens[0..-3] + [(adapter_version_tokens[-2] as int) + 1]
def sdk_next_version = sdk_next_version_tokens.join('.')
sdk_dev_dynamic_version = "[$ext.sdk_version,$sdk_next_version["
devRepository = {
repositories {
maven {
name = "Dev"
setUrl("file://${buildDir}/dev-${adapter_publication_version}")
}
}
}
}
group = "com.criteo.mediation.google"
nexusPublishing {
repositories {
sonatype {
username = "criteo-oss"
password = System.getenv("SONATYPE_PASSWORD")
}
}
}