Compare commits

...
Author SHA1 Message Date
alwx aa95efcd44 Updates 2023-04-04 15:27:26 +02:00
alwx afc8ca1976 DepReport 2023-04-04 14:09:04 +02:00
alwx 33055ffe4f dependencyReportTask 2023-04-04 13:57:56 +02:00
alwx c921a20ee8 Fixes 2023-04-04 13:38:08 +02:00
alwx f028f1d0b9 Last attempt 2023-04-04 13:31:25 +02:00
Alexander 4193750c86 Merge branch 'develop' into gradle-experiments 2023-04-03 18:07:54 +02:00
alwx 735a40275d More updates 2023-04-03 15:40:59 +02:00
alwx cf71ea9acb Experiments with Gradle and dependencies 2023-03-30 17:20:48 +02:00
2 changed files with 53 additions and 0 deletions
+25
View File
@@ -1,3 +1,6 @@
import java.util.stream.Collectors
import im.status.DependencyListTask
// Top-level build file where you can add configuration options common to all sub-projects/modules.
/**
@@ -13,6 +16,14 @@ ext {
gradlePluginVersion = project.gradlePluginVersion
}
def depsSet = new TreeSet<String>()
task printDeps {
doLast {
println(depsSet.stream().sorted().collect(Collectors.toList()))
}
}
buildscript {
repositories {
flatDir { dirs "libs", "${rootDir}/app/libs" }
@@ -28,6 +39,8 @@ buildscript {
}
subprojects {
task allDeps(type: DependencyListTask) { }
afterEvaluate {
if (project.hasProperty("android")) {
android {
@@ -49,6 +62,18 @@ allprojects {
}
}
afterEvaluate {
project.configurations.all { config ->
if (!config.name.toLowerCase().startsWith('test')) {
config.allDependencies.all { dep ->
if (dep.group && dep.name && dep.version && dep.version != "unspecified") {
depsSet.add("${dep.group}:${dep.name}:${dep.version}")
}
}
}
}
}
repositories {
mavenLocal()
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
@@ -0,0 +1,28 @@
package im.status;
import org.gradle.api.artifacts.ConfigurationContainer;
import org.gradle.api.tasks.diagnostics.AbstractDependencyReportTask;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.diagnostics.internal.DependencyReportRenderer;
import org.gradle.api.tasks.diagnostics.internal.ReportRenderer;
import org.gradle.api.tasks.diagnostics.internal.dependencies.AsciiDependencyReportRenderer;
//https://github.com/gradle/gradle/tree/master/subprojects/diagnostics/src/main/java/org/gradle/api/tasks/diagnostics/internal
/**
* Displays the dependency tree for a project. An instance of this type is used when you
* execute the {@code dependencies} task from the command-line.
*/
public abstract class DependencyListTask extends AbstractDependencyReportTask {
@Override
public ConfigurationContainer getTaskConfigurations() {
return getProject().getConfigurations();
}
@TaskAction
void action() {
}
}