@@ -182,23 +182,26 @@ tasks {
182
182
dependsOn(" $os${arch.capitalized()} Jar" )
183
183
}
184
184
185
- val binaryFileProp = layout.buildDirectory.file(" libs/vat-$os -$arch " )
186
- register(" $os${arch.capitalized()} Binary" ) {
187
- description = " Prepends shell script in the jar to improve CLI"
188
- group = " build"
189
-
190
- dependsOn(" $os${arch.capitalized()} Optimize" )
191
-
192
- inputs.file(" build/libs/vat-$os -$arch -$version .jar" )
193
- outputs.file(binaryFileProp)
194
-
195
- doLast {
196
- val binaryFile = binaryFileProp.get().asFile
197
- binaryFile.parentFile.mkdirs()
198
- binaryFile.delete()
199
- binaryFile.appendText(" #!/bin/sh\n\n exec java \$ JAVA_OPTS -jar \$ 0 \" \$ @\"\n\n " )
200
- file(" build/libs/vat-$os -$arch -$version .jar" ).inputStream().use { binaryFile.appendBytes(it.readBytes()) }
201
- binaryFile.setExecutable(true , false )
185
+ if (os != " windows" ) {
186
+ val binaryFileProp = layout.buildDirectory.file(" libs/vat-$os -$arch " )
187
+ register(" $os${arch.capitalized()} Binary" ) {
188
+ description = " Prepends shell script in the jar to improve CLI"
189
+ group = " build"
190
+
191
+ dependsOn(" $os${arch.capitalized()} Optimize" )
192
+
193
+ inputs.file(" build/libs/vat-$os -$arch -$version .jar" )
194
+ outputs.file(binaryFileProp)
195
+
196
+ doLast {
197
+ val binaryFile = binaryFileProp.get().asFile
198
+ binaryFile.parentFile.mkdirs()
199
+ binaryFile.delete()
200
+ binaryFile.appendText(" #!/bin/sh\n\n exec java \$ JAVA_OPTS -jar \$ 0 \" \$ @\"\n\n " )
201
+ file(" build/libs/vat-$os -$arch -$version .jar" ).inputStream()
202
+ .use { binaryFile.appendBytes(it.readBytes()) }
203
+ binaryFile.setExecutable(true , false )
204
+ }
202
205
}
203
206
}
204
207
}
@@ -233,9 +236,12 @@ tasks {
233
236
dependsOn(" $targetOs${targetArch.capitalized()} Optimize" )
234
237
}
235
238
236
- val binary by registering {
237
- description = " Prepends shell script in the jar to improve CLI for the current system ($targetOs -$targetArch )"
238
- group = " build"
239
- dependsOn(" $targetOs${targetArch.capitalized()} Binary" )
239
+ if (targetOs != " windows" ) {
240
+ val binary by registering {
241
+ description =
242
+ " Prepends shell script in the jar to improve CLI for the current system ($targetOs -$targetArch )"
243
+ group = " build"
244
+ dependsOn(" $targetOs${targetArch.capitalized()} Binary" )
245
+ }
240
246
}
241
247
}
0 commit comments