hello, everybody
now , i use a third-party plugin with apply plugin 'xxx' in AndroidStudio, this plugin has a task , we called TaskA , and the TaskA has a input properties , the properties is a extension-object, we called propA, and i want define a task with TaskA’s Type ,so my code like this:
task customTask(type: TaskA){
def p = new propA(project)
propA p
}
this code is in a custom gradle file , i use apply from xxx.gradle to use it , when i run gradlew customTask in commandLine,it report a error :unable to resolve class com.xxx.xxx.TaskA, so what should i do ? please help me ,thx
task addBaseChannel(type: com.leon.plugin.task.RebuildApkChannelPackageTask, dependsOn: 'addYingyongbaoChannelAfterJiagu') {
def extension = new com.leon.plugin.extension.RebuildChannelConfigurationExtension(project)
extension.baseReleaseApk = new File("${project.buildDir}/outputs/apk/base/release", getBaseApkName())
extension.releaseOutputDir = new File("${project.buildDir}/channelRoot/channelDir")
extension.channelFile = new File("${rootProject.rootDir}", "channelFile.txt")
mRebuildChannelExtension = extension
}
when i run gradlew addBaseChannel,it report a error unable to resolve class com.leon.plugin.extension.RebuildChannelConfigurationExtension .
I make sure that the plugin classpath has been configured in the right way.
I’m not 100% clear on the classloader details, but everything I’ve seen shows that the gradle script included via apply from: needs to declare its own buildscript classpath dependencies in order to function. It does not inherit from build.gradle’s buildscript.