Replace OSS licenses plugin with Licensee and some manually done UI.
This should fix both configuration cache and reproducible F-droid builds. Cleanup and remove gplay/fdroid diff on open source licenses. Co-authored by @jmartinesp
This commit is contained in:
parent
9c21a96d3d
commit
b9169e6c76
38 changed files with 983 additions and 309 deletions
|
|
@ -17,13 +17,35 @@
|
|||
package extension
|
||||
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.provider.ValueSource
|
||||
import org.gradle.api.provider.ValueSourceParameters
|
||||
import org.gradle.process.ExecOperations
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.IOException
|
||||
import javax.inject.Inject
|
||||
|
||||
private fun Project.runCommand(cmd: String): String {
|
||||
abstract class GitRevisionValueSource : ValueSource<String, ValueSourceParameters.None> {
|
||||
@get:Inject
|
||||
abstract val execOperations: ExecOperations
|
||||
|
||||
override fun obtain(): String? {
|
||||
return execOperations.runCommand("git rev-parse --short=8 HEAD")
|
||||
}
|
||||
}
|
||||
|
||||
abstract class GitBranchNameValueSource : ValueSource<String, ValueSourceParameters.None> {
|
||||
@get:Inject
|
||||
abstract val execOperations: ExecOperations
|
||||
|
||||
override fun obtain(): String? {
|
||||
return execOperations.runCommand("git rev-parse --abbrev-ref HEAD")
|
||||
}
|
||||
}
|
||||
|
||||
private fun ExecOperations.runCommand(cmd: String): String {
|
||||
val outputStream = ByteArrayOutputStream()
|
||||
val errorStream = ByteArrayOutputStream()
|
||||
project.exec {
|
||||
exec {
|
||||
commandLine = cmd.split(" ")
|
||||
standardOutput = outputStream
|
||||
errorOutput = errorStream
|
||||
|
|
@ -34,7 +56,3 @@ private fun Project.runCommand(cmd: String): String {
|
|||
}
|
||||
return String(outputStream.toByteArray()).trim()
|
||||
}
|
||||
|
||||
fun Project.gitRevision() = runCommand("git rev-parse --short=8 HEAD")
|
||||
|
||||
fun Project.gitBranchName() = runCommand("git rev-parse --abbrev-ref HEAD")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue