Hello,
I have a configuration to download my native toolchain and a task to extract it.
configurations {
compiler
}
dependencies {
compiler ( group: 'com.my.company', name: 'my-compiler', version: '4.6.2', ext: 'tgz' )
}
I have a toolchain configuration:
model {
toolChains {
myArm(Gcc) {
target('arm') {
path '/usr/local/project/build_deps/compilers/arm-cs-tools/bin'
cCompiler.executable 'arm-unknown-linux-gnueabi-g++'
cppCompiler.executable 'arm-unknown-linux-gnueabi-g++'
linker.executable 'arm-unknown-linux-gnueabi-g++'
assembler.executable 'arm-unknown-linux-gnueabi-as'
staticLibArchiver.executable 'arm-unknown-linux-gnueabi-ar'
}
}
}
When I run ./gradlew build, it successfully resolves the dependency and extracts it to the specified location, but on the first execution the compiler fails with this message:
No tool chain is available to build for platform 'arm':
presumably because the compiler was not there when the toolchain configuration took place, only after the task ran. If I run ./gradlew build again and it goes through the configuration phase again, it works fine.
I’d like to be able to give my developers a single command to run to set up their build environment and do the build. What would be the best way to automatically re-configure the toolchain after it is extracted by a task?
Should I get and extract the compiler in an init script? Is there a better way?
Thanks.