-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathbuild.gradle
114 lines (93 loc) · 3.52 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
/*
* Copyright 2000-2019 JetBrains s.r.o.
*
* 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.
*/
import com.intellij.rt.coverage.build.Publishing
import jetbrains.sign.GpgSignSignatoryProvider
import org.gradle.internal.jvm.Jvm
buildscript {
repositories {
maven { url 'https://packages.jetbrains.team/maven/p/jcs/maven' }
}
dependencies {
classpath 'com.jetbrains:jet-sign:38'
}
}
plugins {
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
}
apply plugin: 'signing'
private calcVersion() {
hasProperty("teamcity") ? "1.0.${teamcity["build.number"]}" : ""
}
apply plugin: 'maven-publish'
ext.test_discovery_jar_name = 'intellij-test-discovery-agent'
ext.coverage_jar_name = 'intellij-coverage-agent'
ext.offline_jar_name = 'intellij-coverage-offline'
ext.reporter_jar_name = 'intellij-coverage-reporter'
allprojects {
version calcVersion()
group = "org.jetbrains.intellij.deps"
repositories {
mavenCentral()
}
apply plugin: 'java'
def java5Supported = Jvm.current().javaVersion < JavaVersion.VERSION_11
sourceCompatibility = java5Supported ? 1.5 : 1.6
targetCompatibility = java5Supported ? 1.5 : 1.6
sourceSets {
main.java.srcDirs 'src'
test.java.srcDirs = []
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:-options'
}
if (rootProject.hasProperty("parallel.tests")) {
tasks.withType(Test).configureEach {
maxParallelForks = Math.min(2, Runtime.getRuntime().availableProcessors())
}
}
}
dependencies {
compile(project(':util'))
}
clean.doFirst {
delete "dist"
}
signing {
sign publishing.publications
signatories = new GpgSignSignatoryProvider()
}
tasks.withType(Sign) {
onlyIf { System.getenv("TEAMCITY_VERSION") != null }
}
static def getPublishDependencies(Project project) {
project.configurations.named("externalDependencies").get().getResolvedConfiguration().getFirstLevelModuleDependencies()
}
Publishing.setUpPublication(rootProject, ":instrumentation", coverage_jar_name, "Intellij Coverage Agent", "Code coverage engine for JVM")
Publishing.setUpPublication(rootProject, ":test-discovery", test_discovery_jar_name, "Intellij Test Discovery Agent", "Lightweight coverage during a testing session")
Publishing.setUpPublication(rootProject, ":offline-runtime:api", offline_jar_name, "Intellij Coverage Offline Runtime", "Coverage runtime in offline instrumentation mode with API to collect coverage result at runtime")
project(":reporter").afterEvaluate { Project project ->
def reporterDependencies = getPublishDependencies(project).collect { new Publishing.MyDependency(it.moduleGroup, it.moduleName, it.moduleVersion) }
reporterDependencies.add(new Publishing.MyDependency(group, coverage_jar_name, version))
Publishing.setUpPublication(rootProject, ":reporter", reporter_jar_name, "Intellij Coverage Report", "Library for presenting coverage results", reporterDependencies)
}
nexusPublishing {
repositories {
sonatype {
username = System.getenv('PUBLISHING_USER')
password = System.getenv('PUBLISHING_PASSWORD')
}
}
}