diff --git a/FAQ.md b/FAQ.md index 808d3e62782..d3aadc6cc3f 100644 --- a/FAQ.md +++ b/FAQ.md @@ -57,4 +57,37 @@ Q: How do I make a singleton object mutable? A: Currently, singleton objects are immutable (i.e. frozen after creation), and it's generally considered a good practise to have global state immutable. If for some reasons you need mutable state inside such an object, use `@konan.ThreadLocal` annotation on the object. Also `konan.worker.AtomicReference` class could be -used to store different pointers to frozen objects in a frozen object and atomically update those. \ No newline at end of file +used to store different pointers to frozen objects in a frozen object and atomically update those. + +Q: How can I compile my project against Kotlin/Native master? + +A: We release dev builds frequently, usually at least once a week. You can check the [list of available versions](https://bintray.com/jetbrains/kotlin-native-dependencies/kotlin-native-gradle-plugin). But in the case we recently fixed an issue and you want to check before a release is done, you can do: + +
+ +For the CLI, you can compile using gradle as stated in the README (and if you get errors, you can try to do a ./gradlew clean): + +``` +./gradlew dependencies:update +./gradlew dist distPlatformLibs +``` + +You can then set the `KONAN_HOME` env variable to the generated `dist` folder in the git repository. + +
+ +
+For Gradle, you can use Gradle composite builds like this: + +``` +# Set with the path of your kotlin-native clone +export KONAN_REPO=$PWD/../kotlin-native + +# Run this once since it is costly, you can remove the `clean` task if not big changes were made from the last time you did this +pushd $KONAN_REPO && git pull && ./gradlew clean dependencies:update dist distPlatformLibs && popd + +# In your project, you set have to the konan.home property, and include as composite the shared and gradle-plugin builds +./gradlew check -Pkonan.home=$KONAN_REPO/dist --include-build $KONAN_REPO/shared --include-build $KONAN_REPO/tools/kotlin-native-gradle-plugin +``` + +