我试图在存储库和插件定义的buildscript块之前运行脚本。我有一种情况,我需要在本地安装插件,然后在安装后加载它。现在我的定义看起来像这样
std::array<int, 5> arrayone{ 11, 12, 13, 14, 15 };
std::array<int, 5> facit{ 11, 12, 13, 14, 15 };
和类似的任务
buildscript {
repositories {
mavenLocal()
maven{
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'net.nemerosa:versioning:latest.release'
classpath "com.eriwen:gradle-js-plugin:latest.release"
classpath "com.eriwen:gradle-css-plugin:latest.release"
classpath "org.owasp:dependency-check-gradle:latest.release"
classpath "com.github.ben-manes:gradle-versions-plugin:latest.release"
classpath "gradle.plugin.net.ossindex:ossindex-gradle-plugin:latest.release"
classpath "org.tmatesoft.svnkit:svnkit:latest.release"
classpath "com.github.spotbugs:spotbugs-gradle-plugin:1.6.10-SNAPSHOT"
}
}
['net.nemerosa.versioning', 'com.github.spotbugs', 'com.eriwen.gradle.js', 'css', 'org.owasp.dependencycheck', 'com.github.ben-manes.versions', 'net.ossindex.audit'].each {
apply plugin : it
}
如果我运行任务,该任务将失败,因为它找不到上面定义的插件(它将安装)。
是否有办法解决这个问题,如何要求任务是脚本要做的第一件事?