forked from TSYS-Merchant/syslog4net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
44 lines (38 loc) · 1.41 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.ullink.gradle:gradle-msbuild-plugin:1.9'
}
}
version = '1.0.1-SNAPSHOT'
apply plugin: 'msbuild'
// You can't have non-digits in a DLL version number
project.ext.set("baseVersion", project.version.minus('-SNAPSHOT'))
def user = System.getProperty("user.name")
if ((user == 'jenkins') || (user == 'buildservice')) {
project.ext.set("buildNumber", System.getenv("BUILD_NUMBER"))
project.ext.set("assemblyVersion", project.baseVersion + '.' + project.buildNumber)
} else {
project.ext.set("buildNumber", user + '-' + new Date().format("yyyyMMdd'T'HHmmss'Z'", TimeZone.getTimeZone('UTC')))
project.ext.set("assemblyVersion", project.baseVersion + '.0')
}
msbuild {
projectFile = 'src/main/dot-net/Build.proj'
projectName = project.name
targets = ['Clean', 'Build']
configuration = 'Release'
parameters.version = project.version
parameters.assemblyVersion = project.assemblyVersion
parameters.buildNumber = project.buildNumber
}
msbuild.outputs.upToDateWhen { false }
task build
build.dependsOn msbuild
task packageNuget(type: Exec) {
workingDir 'src/main/dot-net/syslog4net'
commandLine 'cmd', '/c', 'NuGet.exe', 'pack', 'syslog4net.csproj', '-Prop', 'Configuration=Release', '-Version', project.baseVersion
}
packageNuget.dependsOn build
packageNuget.outputs.upToDateWhen { false }