Manually build ReplayStudio dep

This commit is contained in:
Jonas Herzig
2017-08-28 21:30:39 +02:00
parent c44de2b22a
commit 6ef61f0878
6 changed files with 119 additions and 3 deletions

View File

@@ -1,3 +1,7 @@
import java.util.jar.JarEntry
import java.util.jar.JarFile
import java.util.jar.JarOutputStream
def convertRepoToHttp = { repo ->
if (repo instanceof MavenArtifactRepository && repo.url.toString().startsWith('https://')) {
URL url = repo.url.toURL()
@@ -17,4 +21,23 @@ allprojects {
dirMode = 0775
fileMode = 0664
}
// The shadow plugin doesn't seem to support the above
def shadowJar = tasks.findByPath ':shadowJar'
if (shadowJar != null) {
shadowJar.doLast {
File newFile = new File(archivePath.parent, 'tmp-' + archiveName)
newFile.withOutputStream { fout ->
JarOutputStream out = new JarOutputStream(fout)
JarFile jf = new JarFile(archivePath)
jf.entries().unique {it.name}.sort {it.name}.each {
def copy = new JarEntry(it.name)
copy.time = 0
out.putNextEntry(copy)
out << jf.getInputStream(it)
}
out.finish()
}
newFile.renameTo archivePath
}
}
}