mirror of
https://github.com/recloudstream/gradle.git
synced 2024-08-14 23:56:59 +00:00
Compare commits
12 commits
964c425973
...
1e0b457503
Author | SHA1 | Date | |
---|---|---|---|
|
1e0b457503 | ||
|
a9f1ef0fbb | ||
|
26c1af5710 | ||
|
e46204f939 | ||
|
18915372d0 | ||
|
de10dccb38 | ||
|
3810f1a580 | ||
|
269e597e4e | ||
|
b8745441c7 | ||
|
8d84a80740 | ||
|
77686b33fd | ||
|
ba11261aac |
7 changed files with 21 additions and 7 deletions
5
.github/workflows/jitpack.yml
vendored
5
.github/workflows/jitpack.yml
vendored
|
@ -14,3 +14,8 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
wget "https://jitpack.io/com/github/recloudstream/gradle/${GITHUB_REF##*/}-${SHORT_SHA}-1/build.log" -T 300
|
wget "https://jitpack.io/com/github/recloudstream/gradle/${GITHUB_REF##*/}-${SHORT_SHA}-1/build.log" -T 300
|
||||||
cat build.log
|
cat build.log
|
||||||
|
- name: Check status
|
||||||
|
run: |
|
||||||
|
if grep -q "FAILURE: Build failed with an exception." build.log; then
|
||||||
|
echo "::error::Jitpack build failed with an exception." && exit 1
|
||||||
|
fi
|
|
@ -37,6 +37,7 @@ abstract class CloudstreamExtension @Inject constructor(project: Project) {
|
||||||
}
|
}
|
||||||
|
|
||||||
internal var pluginClassName: String? = null
|
internal var pluginClassName: String? = null
|
||||||
|
internal var fileSize: Long? = null
|
||||||
|
|
||||||
var requiresResources = false
|
var requiresResources = false
|
||||||
var description: String? = null
|
var description: String? = null
|
||||||
|
|
|
@ -47,6 +47,7 @@ fun Project.makePluginEntry(): PluginEntry {
|
||||||
language = extension.language,
|
language = extension.language,
|
||||||
iconUrl = extension.iconUrl,
|
iconUrl = extension.iconUrl,
|
||||||
apiVersion = extension.apiVersion,
|
apiVersion = extension.apiVersion,
|
||||||
tvTypes = extension.tvTypes
|
tvTypes = extension.tvTypes,
|
||||||
|
fileSize = extension.fileSize
|
||||||
)
|
)
|
||||||
}
|
}
|
|
@ -8,6 +8,7 @@ data class PluginEntry(
|
||||||
val internalName: String,
|
val internalName: String,
|
||||||
val authors: List<String>,
|
val authors: List<String>,
|
||||||
val description: String?,
|
val description: String?,
|
||||||
|
val fileSize: Long?,
|
||||||
val repositoryUrl: String?,
|
val repositoryUrl: String?,
|
||||||
val language: String?,
|
val language: String?,
|
||||||
val tvTypes: List<String>?,
|
val tvTypes: List<String>?,
|
||||||
|
|
|
@ -43,7 +43,7 @@ abstract class DeployWithAdbTask : DefaultTask() {
|
||||||
|
|
||||||
device.push(file, RemoteFile(path + file.name))
|
device.push(file, RemoteFile(path + file.name))
|
||||||
|
|
||||||
val args = arrayListOf("start", "-S", "-n", "com.lagradost.cloudstream3.debug/com.lagradost.cloudstream3.MainActivity")
|
val args = arrayListOf("start", "-a", "android.intent.action.VIEW", "-d", "cloudstreamapp:")
|
||||||
|
|
||||||
if (waitForDebugger) {
|
if (waitForDebugger) {
|
||||||
args.add("-D")
|
args.add("-D")
|
||||||
|
|
|
@ -10,6 +10,7 @@ import org.gradle.api.file.RegularFileProperty
|
||||||
import org.gradle.api.tasks.OutputFile
|
import org.gradle.api.tasks.OutputFile
|
||||||
import org.gradle.api.tasks.TaskAction
|
import org.gradle.api.tasks.TaskAction
|
||||||
import java.util.LinkedList
|
import java.util.LinkedList
|
||||||
|
import java.lang.Thread
|
||||||
|
|
||||||
abstract class MakePluginsJsonTask : DefaultTask() {
|
abstract class MakePluginsJsonTask : DefaultTask() {
|
||||||
@get:OutputFile
|
@get:OutputFile
|
||||||
|
@ -20,7 +21,7 @@ abstract class MakePluginsJsonTask : DefaultTask() {
|
||||||
val lst = LinkedList<PluginEntry>()
|
val lst = LinkedList<PluginEntry>()
|
||||||
|
|
||||||
for (subproject in project.allprojects) {
|
for (subproject in project.allprojects) {
|
||||||
val cloudstream = subproject.extensions.findCloudstream() ?: continue
|
subproject.extensions.findCloudstream() ?: continue
|
||||||
|
|
||||||
lst.add(subproject.makePluginEntry())
|
lst.add(subproject.makePluginEntry())
|
||||||
}
|
}
|
||||||
|
@ -33,5 +34,7 @@ abstract class MakePluginsJsonTask : DefaultTask() {
|
||||||
.build()
|
.build()
|
||||||
).toPrettyString()
|
).toPrettyString()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
logger.lifecycle("Created ${outputFile.asFile.get()}")
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -11,7 +11,8 @@ import org.gradle.api.Project
|
||||||
import org.gradle.api.tasks.AbstractCopyTask
|
import org.gradle.api.tasks.AbstractCopyTask
|
||||||
import org.gradle.api.tasks.bundling.Zip
|
import org.gradle.api.tasks.bundling.Zip
|
||||||
import org.gradle.api.tasks.compile.AbstractCompile
|
import org.gradle.api.tasks.compile.AbstractCompile
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
import com.lagradost.cloudstream3.gradle.findCloudstream
|
||||||
|
|
||||||
const val TASK_GROUP = "cloudstream"
|
const val TASK_GROUP = "cloudstream"
|
||||||
|
|
||||||
|
@ -22,7 +23,7 @@ fun registerTasks(project: Project) {
|
||||||
if (project.rootProject.tasks.findByName("makePluginsJson") == null) {
|
if (project.rootProject.tasks.findByName("makePluginsJson") == null) {
|
||||||
project.rootProject.tasks.register("makePluginsJson", MakePluginsJsonTask::class.java) {
|
project.rootProject.tasks.register("makePluginsJson", MakePluginsJsonTask::class.java) {
|
||||||
it.group = TASK_GROUP
|
it.group = TASK_GROUP
|
||||||
|
|
||||||
it.outputs.upToDateWhen { false }
|
it.outputs.upToDateWhen { false }
|
||||||
|
|
||||||
it.outputFile.set(it.project.buildDir.resolve("plugins.json"))
|
it.outputFile.set(it.project.buildDir.resolve("plugins.json"))
|
||||||
|
@ -81,7 +82,7 @@ fun registerTasks(project: Project) {
|
||||||
}
|
}
|
||||||
|
|
||||||
project.afterEvaluate {
|
project.afterEvaluate {
|
||||||
project.tasks.register("make", Zip::class.java) {
|
val make = project.tasks.register("make", Zip::class.java) {
|
||||||
val compileDexTask = compileDex.get()
|
val compileDexTask = compileDex.get()
|
||||||
it.dependsOn(compileDexTask)
|
it.dependsOn(compileDexTask)
|
||||||
|
|
||||||
|
@ -116,9 +117,11 @@ fun registerTasks(project: Project) {
|
||||||
zip.destinationDirectory.set(project.buildDir)
|
zip.destinationDirectory.set(project.buildDir)
|
||||||
|
|
||||||
it.doLast { task ->
|
it.doLast { task ->
|
||||||
|
extension.fileSize = task.outputs.files.singleFile.length()
|
||||||
task.logger.lifecycle("Made Cloudstream package at ${task.outputs.files.singleFile}")
|
task.logger.lifecycle("Made Cloudstream package at ${task.outputs.files.singleFile}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
project.rootProject.tasks.getByName("makePluginsJson").dependsOn(make)
|
||||||
}
|
}
|
||||||
|
|
||||||
project.tasks.register("cleanCache", CleanCacheTask::class.java) {
|
project.tasks.register("cleanCache", CleanCacheTask::class.java) {
|
||||||
|
@ -129,4 +132,4 @@ fun registerTasks(project: Project) {
|
||||||
it.group = TASK_GROUP
|
it.group = TASK_GROUP
|
||||||
it.dependsOn("make")
|
it.dependsOn("make")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue