diff options
Diffstat (limited to 'developmentPlugins')
4 files changed, 31 insertions, 20 deletions
diff --git a/developmentPlugins/build.gradle b/developmentPlugins/build.gradle index d83764b2..dd706461 100644 --- a/developmentPlugins/build.gradle +++ b/developmentPlugins/build.gradle @@ -1,9 +1,9 @@ -ext.rootFolder = "${project.projectDir}/.." +ext.dataBindingRootFolder = "${project.projectDir}/.." apply from: '../propLoader.gradle' subprojects { apply plugin: 'maven' - group = config.group - version = config.extraPluginsVersion + group = dataBindingConfig.group + version = dataBindingConfig.extraPluginsVersion uploadArchives { repositories { mavenDeployer { diff --git a/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/ExportLicensesTask.groovy b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/ExportLicensesTask.groovy index cf3ef59c..4db1f39b 100644 --- a/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/ExportLicensesTask.groovy +++ b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/ExportLicensesTask.groovy @@ -24,7 +24,8 @@ class ExportLicensesTask extends DefaultTask { static def knownLicenses = [ [ - libraries: ["kotlin-stdlib", "kotlin-runtime", "kotlin-annotation-processing", "kotlin-gradle-plugin", "kotlin-gradle-plugin-api"], + libraries: ["kotlin-stdlib", "kotlin-runtime", "kotlin-annotation-processing", "kotlin-gradle-plugin", "kotlin-gradle-plugin-api", + "kdoc", "kotlin-gradle-plugin-core", "kotlin-jdk-annotations", "kotlin-compiler", "kotlin-compiler-embeddable"], licenses : ["https://raw.githubusercontent.com/JetBrains/kotlin/master/license/LICENSE.txt", "http://www.apache.org/licenses/LICENSE-2.0.txt"], notices : ["https://raw.githubusercontent.com/JetBrains/kotlin/master/license/NOTICE.txt"] @@ -96,9 +97,12 @@ class ExportLicensesTask extends DefaultTask { ], [ libraries: ["logkit"], - licenses: ["unknown. see: http://commons.apache.org/proper/commons-logging/dependencies.html"] - ] - + licenseText: ["unknown. see: http://commons.apache.org/proper/commons-logging/dependencies.html"] + ], + [ + libraries: ["juniversalchardet"], + licenses: ["https://mozorg.cdn.mozilla.net/media/MPL/1.1/index.0c5913925d40.txt"] + ], ] Map<String, Object> usedLicenses = new HashMap<>(); @@ -121,12 +125,15 @@ class ExportLicensesTask extends DefaultTask { @TaskAction public void exportNotice() { - project.configurations.compile.getResolvedConfiguration().getResolvedArtifacts().each { - add(it) + project.configurations.compile.getResolvedConfiguration() + .getFirstLevelModuleDependencies().each { + if (!it.getModuleGroup().equals("com.android.tools.build")) { + it.getAllModuleArtifacts().each { add(it) } + } } resolveLicenses() def notice = buildNotice(usedLicenses) - def noticeFile = new File(project.buildDir,'NOTICE.txt') + def noticeFile = new File("${project.projectDir}/src/main/resources",'NOTICE.txt') noticeFile.delete() println ("writing notice file to: ${noticeFile.getAbsolutePath()}") noticeFile << notice @@ -149,8 +156,7 @@ class ExportLicensesTask extends DefaultTask { } public static String urlToText(String url) { - //return new URL(url).getText() - return url + return new URL(url).getText() } public boolean shouldSkip(ResolvedArtifact artifact) { @@ -174,6 +180,9 @@ class ExportLicensesTask extends DefaultTask { license.licenses.each { notice.append("\n ****** LICENSE:\n${urlToText(it)}") } + license.licenseText.each { + notice.append("\n ****** LICENSE:\n${it}") + } notice.append("\n\n\n") } return notice.toString() diff --git a/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/LocalizeDependenciesTask.groovy b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/LocalizeDependenciesTask.groovy index a9e8d058..ad2d5c8b 100644 --- a/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/LocalizeDependenciesTask.groovy +++ b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/LocalizeDependenciesTask.groovy @@ -64,9 +64,10 @@ class LocalizeDependenciesTask extends DefaultTask { LocalizePluginExtension extension = project.extensions. getByName(MavenDependencyCollectorPlugin.EXTENSION_NAME) if (extension.localRepoDir == null || extension.otherRepoDirs == null) { - throw new IllegalArgumentException("you must configure " + - "${MavenDependencyCollectorPlugin.EXTENSION_NAME} with localRepoDir and" + - " otherRepoDirs") +// throw new IllegalArgumentException("you must configure " + +// "${MavenDependencyCollectorPlugin.EXTENSION_NAME} with localRepoDir and" + +// " otherRepoDirs") + return } localRepoDir = extension.localRepoDir downloadAll(extension.localRepoDir, extension.otherRepoDirs) diff --git a/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/MavenDependencyCollectorPlugin.groovy b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/MavenDependencyCollectorPlugin.groovy index c3a318d3..fd163da4 100644 --- a/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/MavenDependencyCollectorPlugin.groovy +++ b/developmentPlugins/localizeMavenPlugin/src/main/groovy/android/databinding/MavenDependencyCollectorPlugin.groovy @@ -34,11 +34,12 @@ public class MavenDependencyCollectorPlugin implements Plugin<Project> { project.allprojects { afterEvaluate { p -> - project.tasks.create("collectDependenciesOf${it.getName().capitalize()}", MavenDependencyCollectorTask, { - it.localizeTask = localizeDependenciesTask - localizeDependenciesTask.dependsOn it - }) - + if (!p.name.equals("dataBinding")) { + project.tasks.create("collectDependenciesOf${it.getName().capitalize()}", MavenDependencyCollectorTask, { + it.localizeTask = localizeDependenciesTask + localizeDependenciesTask.dependsOn it + }) + } } } project.tasks.create("buildLicenseNotice", ExportLicensesTask) { |