나는이 대답은 조금 늦게 온다 알고 있지만, 아직 ...
당신이 쓴
transitive
PARAM은의
pom.xml
파일에 설정 될 필요가 이적 의존성 (당신의 의존성의 의존성)를 포함하는 것입니다 종속성을
compile
으로 설정하십시오. 따라서 다른 용도로 사용하지 않는 한
aar
포장에 대해서는 실제로 그렇게 할 필요가 없습니다.
첫째, 당신은합니다 ( libs
폴더) 내부의 jar
들과 aar
패키지 할 수 있습니다,하지만 당신은 aar
내부에 aar
을 패키지 할 수 있다고 생각합니다. 문제를 해결하기
접근 방식은 다음과 같습니다.
- 당신이에 관심이있는 종속성에서 해결 된 유물을 얻기 해결 유물의 사람이
jar
파일은
- 확인합니다.
jar
인 경우 폴더에 복사하고 dependencies
폴더의 compile
폴더로 설정하십시오.
그래서 더 많거나 같은 덜 뭔가 :
configurations {
mypackage // create a new configuration, whose dependencies will be inspected
}
dependencies {
mypackage 'com.zendesk:sdk:1.7.0.1' // set your dependency referenced by the mypackage configuration
compile fileTree(dir: "${buildDir.path}/resolvedArtifacts", include: ['*.jar']) // this will compile the jar files within that folder, although the files are not there yet
}
task resolveArtifacts(type: Copy) {
// iterate over the resolved artifacts from your 'mypackage' configuration
configurations.mypackage.resolvedConfiguration.resolvedArtifacts.each { ResolvedArtifact resolvedArtifact ->
// check if the resolved artifact is a jar file
if ((resolvedArtifact.file.name.drop(resolvedArtifact.file.name.lastIndexOf('.') + 1) == 'jar')) {
// in case it is, copy it to the folder that is set to 'compile' in your 'dependencies' closure
from resolvedArtifact.file
into "${buildDir.path}/resolvedArtifacts"
}
}
}
이제
./gradlew clean resolveArtifacts build
을 실행할 수 있으며,
aar
패키지 안에 해결
jar
들 것이다.
이 정보가 도움이되기를 바랍니다.
하지만 해상도는 삭제됩니다. –