This repository has been archived by the owner on Oct 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle
117 lines (101 loc) · 3.49 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
plugins {
id 'com.gradle.plugin-publish' version '0.15.0'
id 'maven-publish'
id 'java-gradle-plugin'
}
repositories {
maven { url 'https://maven.google.com' }
mavenCentral()
jcenter()
}
apply plugin: 'groovy'
apply plugin: 'java-gradle-plugin'
apply plugin: 'java-library'
// Run the following to update the lockfiles
// ./gradlew dependencies --write-locks
configurations.all {
it.resolutionStrategy.activateDependencyLocking()
}
// NOTE: Take caution when updating targetCompatibility,
// it will become minimum required JVM version for projects consuming this plugin.
// This value is mapped to "org.gradle.jvm.version" published in the .module file.
// Run "./gradlew outgoingVariants --variant runtimeElements" to confirm the version
compileJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
compileGroovy {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
dependencies {
implementation gradleApi()
implementation localGroovy()
// These are compileOnly just so we can inspect these classes in IntelliJ
// Android Gradle Plugin (AGP)
compileOnly 'com.android.tools.build:gradle:4.2.1'
testCompileOnly 'com.android.tools.build:gradle:4.2.1'
// Google Play Services Gradle Plugin
compileOnly 'com.google.gms:google-services:4.3.+'
testCompileOnly 'com.google.gms:google-services:4.3.+'
// Google's strict version matcher plugin
compileOnly 'com.google.android.gms:strict-version-matcher-plugin:1.2.+'
testCompileOnly 'com.google.android.gms:strict-version-matcher-plugin:1.2.+'
testImplementation gradleTestKit()
testImplementation 'junit:junit:4.12'
testImplementation('org.spockframework:spock-core:2.0-groovy-3.0') {
exclude module: 'groovy-all'
}
}
group = 'gradle.plugin.com.onesignal'
version = '0.14.0'
description 'OneSignal Gradle Plugin'
// Run to upload a new version to the Gradle Plugin Portal
// ./gradlew publishPlugins
pluginBundle {
website = 'http://onesignal.com/'
vcsUrl = 'https://github.com/OneSignal/OneSignal-Gradle-Plugin'
plugins {
plugin {
id = 'com.onesignal.androidsdk.onesignal-gradle-plugin'
displayName = 'OneSignal Gradle Plugin'
description = project.description
tags = ['OneSignal', 'Android', 'push', 'notifications', 'GCM', 'FCM']
}
}
}
gradlePlugin {
plugins {
plugin {
id = 'com.onesignal.androidsdk.onesignal-gradle-plugin'
implementationClass = 'com.onesignal.androidsdk.GradleProjectPlugin'
}
}
}
test {
// Required for Spock 2
useJUnitPlatform()
testLogging {
showStandardStreams = true
exceptionFormat = 'full'
}
}
// Build for Local Testing
publishing {
repositories {
maven {
name = 'localPluginRepository'
url = '../local-plugin-repository'
}
}
}
// ## Steps to use a local copy of this plugin to test
// 1. Run from root to create local package
// ./gradlew publish
// 2. In <projectRoot>/build.gradle of your test project add the following to buildscript -> repositories {..}
// maven { url uri('file://C:\\repos\\local-plugin-repository') }
// 3. Update file:// from above to your correct path
// 4. Add to buildscript -> dependencies
// classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.14.0, 0.99.99]'
// 5. To your app/build.gradle add
// apply plugin: com.onesignal.androidsdk.GradleProjectPlugin