如何解决如何直接从 GitHub 存储库应用 Gradle 插件
我尝试直接从 plugin
存储库申请 GitHub
,例如如下所示
apply from 'https://github.com/gradle/gradle-hello-world-plugin'
但正在运行
./gradlew codeLines
它给了我错误
* Where:
Script 'https://github.com/SurpSG/code-lines-counter-gradle-plugin' line: 7
* What went wrong:
Could not compile script 'https://github.com/SurpSG/code-lines-counter-gradle-plugin'.
> startup failed:
script 'https://github.com/SurpSG/code-lines-counter-gradle-plugin': 7: unexpected token: < @ line 7,column 1.
<!DOCTYPE html>
^
如何从远程 git repo 直接 apply plugin
?
解决方法
我认为这不可能。最接近的想法是克隆插件,构建它并指向它
buildscript {
repositories {
[...]
}
dependencies {
classpath files('relative/path/to/gradle-hello-world-plugin.jar')
}
}
apply plugin: org.gradle.plugin.HelloWorldPlugin
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。