# Gradle 2.3-rc-4 is now available for testing

**URL:** <https://discuss.gradle.org/t/gradle-2-3-rc-4-is-now-available-for-testing/7726>\
**Category:** Old Forum Archive\
**Created:** [February 11, 2015, 4:59pm UTC](https://discuss.gradle.org/t/gradle-2-3-rc-4-is-now-available-for-testing/7726 "2015-02-11T16:59:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sterling](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/sterling/32/5395_2.png) [@sterling](https://discuss.gradle.org/u/sterling)\
**Post date:** [February 11, 2015, 4:59pm UTC](https://discuss.gradle.org/t/gradle-2-3-rc-4-is-now-available-for-testing/7726/1 "2015-02-11T16:59:00Z")

</div>

The Gradle team is pleased to announce that the 4th release candidate for Gradle 2.3 is now available.

Download links and release notes can be found as always at [http://gradle.org/release-candidate](http://gradle.org/release-candidate).

This 4th release candidate for 2.3 adds fixes for GRADLE-3240 that affected Ivy exclusion rules and some documentation formatting issues. Please see the release notes for more information on how this may affect your builds.

Please try Gradle 2.3-rc-4 with your projects and let us know your experiences. We expect to release Gradle 2.3 final very soon.

Thanks,

-Sterling

---

<div class="post-metadata">

**Author:** ![Marco\_Erdmann](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@Marco\_Erdmann](https://discuss.gradle.org/u/Marco_Erdmann)\
**Post date:** [February 13, 2015, 7:44am UTC](https://discuss.gradle.org/t/gradle-2-3-rc-4-is-now-available-for-testing/7726/2 "2015-02-13T07:44:00Z")

</div>

Hi there,

I migrated a mixed C++/Java project yesterday to Gradle 2.3 RC 4 which went astonishingly well. Unfortunately I encountered a small problem with compiling for different available platforms in the native part of the build. My model specifies buildTypes and platforms like so

```gradle
buildTypes {
    debug
    release
  }
    platforms {
    x64 { architecture "x86_64" }
    x86 { architecture "x86" }
     }

```

Up to and including Gradle 2.2.1 this automatically compiled x86 and x86\_64 variants for Debug and Release targets of my two native libraries on Windows. I am currently using Visual Studio 2013 as tool chain here. After upgrading to Gradle 2.3 RC 4 only the x86 part is build which is unfortunate because my Java runtime is of course 64 bit and so I cannot load the resulting JNI library in the testing phase. Do you have an idea what I am doing wrong here? Any idea would be appreciated.

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daz/32/2475_2.png) [@daz](https://discuss.gradle.org/u/daz)\
**Post date:** [February 13, 2015, 4:48pm UTC](https://discuss.gradle.org/t/gradle-2-3-rc-4-is-now-available-for-testing/7726/3 "2015-02-13T16:48:00Z")

</div>

The native support has undergone some fundamental changes in Gradle 2.3, as mentioned in [http://gradle.org/docs/release-candidate/release-notes#major-changes-to-incubating-‘native-component’-and-‘jvm-component’-plugins](http://gradle.org/docs/release-candidate/release-notes#major-changes-to-incubating-'native-component'-and-'jvm-component'-plugins).

However, one change that should probably be explicitly called out is that Gradle will now build variants for the ‘current’ platform only: Gradle makes a very limited attempt to determine the best platform to build for. If you want to build for a different platform, then you can explicitly target the component to that target platform:

```gradle
components {
    myLib(NativeLibrarySpec) {
        targetPlatform "x86"
        targetPlatform "x86_64"
    }
}

```

Note that Gradle makes a set of platforms available to you by default, so you can probably get away without a ‘platforms’ block:

```gradle
components {
    myLib(NativeLibrarySpec) {
        targetPlatform "windows_x86"
        targetPlatform "windows_x86_64"
    }
}

```

The set of platforms is not currently documented, see [the source](https://github.com/gradle/gradle/blob/master/subprojects/platform-native/src/main/groovy/org/gradle/nativeplatform/platform/internal/NativePlatforms.java) for more details. Note that this mechanism is almost certainly going to change further in Gradle 2.4.

---

<div class="post-metadata">

**Author:** ![Marco\_Erdmann](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@Marco\_Erdmann](https://discuss.gradle.org/u/Marco_Erdmann)\
**Post date:** [February 13, 2015, 6:49pm UTC](https://discuss.gradle.org/t/gradle-2-3-rc-4-is-now-available-for-testing/7726/4 "2015-02-13T18:49:00Z")

</div>

Hi Daz,

thanks for pointing me to the source. The following code seems to have been the culprit all along

```gradle
// TODO:DAZ This is a very limited implementation of defaults, just to get the build passing
if (os.isWindows()) {
     // Always use x86 as default on windows
     return platformName(OS_WINDOWS, ARCH_X86);
}

```

I am building on Windows, Linux and OS X and only on 64-bit Windows Gradle chooses to build 32-bit binaries. In my case this is not what I want, which brought me to the platforms block previously. Removing it now breaks the build as I reference targetPlatform == platforms.x64 in the repositories block for prebuild binaries (and also in the binaries block).

So, if I understand you correctly with the changes the way forward in Gradle 2.3 is to specify the targetPlatform explicitly, i.e. I would like to pase it on the current operating system architecture. I will see how that goes.

I was aware of the fact that the native build support is undergoing fundamental changes currently, but the project is in mid-development and I like to integrate early with my dependencies (Gradle being one of them, along with Jersey, Casablanca, Boost, OpenSSL and some others) instead of being stuck with an old Gradle version.

May I ask why Gradle only on Windows assumes that 32-bit is the correct platform even if compiling on 64-bit? Neither Linux nor OS X follow that assumption…

Thanks a lot,

Marco

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daz/32/2475_2.png) [@daz](https://discuss.gradle.org/u/daz)\
**Post date:** [February 13, 2015, 7:06pm UTC](https://discuss.gradle.org/t/gradle-2-3-rc-4-is-now-available-for-testing/7726/5 "2015-02-13T19:06:00Z")

</div>

You don’t _need_ to remove the ‘platforms’ block: the simplest change should be to follow the first example I gave above.

Alternatively, you could remove the ‘platforms’ block, and only reference the ‘canned’ platforms in your build script. If you want to target all platforms with x86-64 architecture, you can use ‘[platform.architecture.name](http://platform.architecture.name) == ‘x86-64’’ (the canonical architecture name).

The reason for windows targeting x86 by default is exactly as it says in the comment: “just to get the build passing”. Unfortunately this stuff was de-prioritised and I wasn’t able to take it further. That should be addressed in Gradle 2.4 (I hope).

---

<div class="post-metadata">

**Author:** ![Marco\_Erdmann](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@Marco\_Erdmann](https://discuss.gradle.org/u/Marco_Erdmann)\
**Post date:** [February 13, 2015, 7:46pm UTC](https://discuss.gradle.org/t/gradle-2-3-rc-4-is-now-available-for-testing/7726/6 "2015-02-13T19:46:00Z")

</div>

Thanks for your suggestions, I will try to apply them tomorrow and I am looking forward to further changes to the native build support in 2.4. My build is currently rather involved, I guess partially because of my own ignorance and partially because one still has to provide many things to the compiler and linker. Anyhow your help is much appreciated.

---

<div class="post-metadata">

**Author:** ![Marco\_Erdmann](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@Marco\_Erdmann](https://discuss.gradle.org/u/Marco_Erdmann)\
**Post date:** [February 13, 2015, 8:36pm UTC](https://discuss.gradle.org/t/gradle-2-3-rc-4-is-now-available-for-testing/7726/7 "2015-02-13T20:36:00Z")

</div>

OK, to wrap this up: I applied your very first suggestion and added the 'targetPlatform’s explicitly. Works like a charm.
