-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathbuild.gradle
99 lines (81 loc) · 2.32 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
plugins {
id 'com.gradle.plugin-publish' version '0.15.0'
id 'com.itiviti.dotnet' version '2.0.1'
id 'net.researchgate.release' version '2.6.0'
id 'de.undercouch.download' version '4.1.2'
}
group = 'com.ullink.gradle'
apply plugin: 'java-gradle-plugin'
apply plugin: 'groovy'
apply plugin: 'com.gradle.plugin-publish'
apply plugin: 'maven-publish'
description 'Gradle plugin for MSBuild project build.'
ext.dotnetPath = file('src/main/dotnet')
java {
sourceCompatibility = JavaVersion.VERSION_1_8
}
dependencies {
testImplementation(platform('org.junit:junit-bom:5.10.1'))
testImplementation('org.junit.jupiter:junit-jupiter')
testImplementation 'org.spockframework:spock-core:2.3-groovy-2.5'
implementation 'net.java.dev.jna:jna:4.2.2'
implementation 'net.java.dev.jna:jna-platform:4.2.2'
implementation 'com.google.guava:guava:32.0.0-jre'
}
test {
useJUnitPlatform()
}
dotnet {
solution = 'ProjectFileParser.sln'
projectName = 'ProjectFileParser'
}
tasks.test.dependsOn(tasks.named('dotnetTest'))
tasks.register('generateZip', Zip) {
dependsOn tasks.named('dotnetBuild')
from { dotnet.mainProject.properties.TargetDir } {
include '*.exe'
include '*.json'
include '*.dll'
}
into '/'
archiveFileName = 'ProjectFileParser.zip'
}
tasks.register('downloadVsWhere', de.undercouch.gradle.tasks.download.Download) {
src 'https://github.com/Microsoft/vswhere/releases/download/2.8.4/vswhere.exe'
dest "$temporaryDir/vswhere.exe"
}
jar {
from(generateZip.outputs.files) {
into ('META-INF')
}
}
sourceSets {
main {
resources {
srcDirs = [ downloadVsWhere.temporaryDir ]
}
}
}
test {
useJUnitPlatform()
}
pluginBundle {
website = 'https://github.com/Itiviti/gradle-msbuild-plugin'
vcsUrl = 'https://github.com/Itiviti/gradle-msbuild-plugin'
tags = ['msbuild', 'c#', '.net']
mavenCoordinates {
groupId = 'com.ullink.gradle'
}
}
gradlePlugin {
plugins {
msbuildPlugin {
id = 'com.ullink.msbuild'
description = project.description
displayName = 'Gradle MSBuild Plugin'
implementationClass = 'com.ullink.MsbuildPlugin'
}
}
}
processResources.dependsOn downloadVsWhere
afterReleaseBuild.dependsOn publishPlugins