Gradle afterResolve从未调用过Configuration

时间:2015-02-06 17:30:57

标签: gradle

当我明确地调用configurations.customConfig.resolve()而不是afterResolve被调用时,否则它永远不会发生。由于我告诉Gradle不要缓存更改的模块,我假设每次都会调用afterResolve。即使我手动清理Gradle的缓存afterResolve也不会被调用。为什么呢?

configurations {
    customConfig
}

dependencies {
    customConfig('org.foo:foo:1.0') {
        changing = true
    }
}

configurations.customConfig {

    //make sure it will be resolved every time
    resolutionStrategy {
        cacheChangingModulesFor 0, 'seconds'
    }

    incoming.afterResolve {
        //never called
    }
}

0 个答案:

没有答案