@@ -95,9 +95,48 @@ task dotnetBuild(
95
95
}
96
96
}
97
97
98
- task dist (type : Exec , dependsOn : [" dotnetBuild" ]) {
99
- environment " CSHARP_XMLRESOLVER_ROOT" , projectDir
100
- commandLine dotnetex, " test" , " XmlResolverData/UnitTests/UnitTests.csproj"
98
+ task " dotnetTest" (
99
+ ) {
100
+ doLast {
101
+ exec {
102
+ workingDir = projectDir
103
+ environment " CSHARP_XMLRESOLVER_ROOT" , projectDir
104
+ commandLine dotnetex, ' test' , ' XmlResolverData/XmlResolverData.sln' ,
105
+ ' --verbosity' , ' Normal' , ' --configuration' , ' Release' ,
106
+ ' --no-build' , ' /p:CollectCoverage=true' ,
107
+ ' /p:ExcludeByFile="**/*.designer.cs;**/*.xaml.cs;**/*.g.cs"' ,
108
+ ' /p:CoverletOutputFormat=opencover' ,
109
+ " /p:CoverletOutput=${ buildDir} /reports/coverlet/" ,
110
+ ' --' ,
111
+ " NUnit.TestOutputXml=${ buildDir} /reports/nunit"
112
+ }
113
+ }
114
+ }
115
+
116
+ task " dotnetNugetPush" (
117
+ ) {
118
+ dependsOn " dotnetBuild" , " dotnetTest"
119
+
120
+ inputs. files " ${ projectDir} /XmlResolverData/XmlResolverData/bin/Release/XmlResolverData.${ dataVersion} .nupkg"
121
+
122
+ doLast {
123
+ exec {
124
+ workingDir = projectDir
125
+ commandLine dotnetex, " restore" , " XmlResolverData/XmlResolverData.sln" , " --verbosity" , " Normal"
126
+ }
127
+ }
128
+
129
+ doLast {
130
+ exec {
131
+ workingDir = projectDir
132
+ commandLine dotnetex, " nuget" , " push" ,
133
+ " ${ projectDir} /XmlResolverData/XmlResolverData/bin/Release/XmlResolverData.${ dataVersion} .nupkg" ,
134
+ " --api-key" , nugetApiKey, " --source" , nugetSource
135
+ }
136
+ }
137
+ }
138
+
139
+ task dist (type : Exec , dependsOn : [" dotnetBuild" , " dotnetTest" ]) {
101
140
}
102
141
103
142
task helloWorld () {
0 commit comments