Skip to content

Prepare SWT app for multiproject build

Andrey Hihlovskiy edited this page Aug 4, 2014 · 18 revisions

We already configured SWT products. Now we prepare SWT app for multiproject build.

Create root "build.gradle"

Create "build.gradle" in "tutorials" folder (parent of "MySwtApp" folder).

Move "buildscript" and "repositories" from "tutorials/MySwtApp/build.gradle" to "tutorials/build.gradle", so that two scripts look like this:

"tutorials/build.gradle":

buildscript {
  repositories {
    mavenLocal()
    jcenter()
  }
  
  dependencies {
    classpath 'org.akhikhl.wuff:wuff-plugin:+'
  }
}

subprojects {
  repositories {
    mavenLocal()
    jcenter()
  }
}

"tutorials/MySwtApp/build.gradle":

apply plugin: 'java'
apply plugin: 'org.akhikhl.wuff.swt-app'
  
products {
  product platform: 'linux', arch: 'x86_32'
  product platform: 'linux', arch: 'x86_64'
  product platform: 'windows', arch: 'x86_32'
  product platform: 'windows', arch: 'x86_64'
  product platform: 'macosx', arch: 'x86_64'
  archiveProducts = true
}

Create "settings.gradle"

Create "settings.gradle" in "tutorials" folder (parent of "MySwtApp" folder), insert code:

include 'MySwtApp'

Compile

Invoke on command line in "tutorials" folder: gradle build.

Check: build task must generate products in "tutorials/MySwtApp/build/output" folder.


The example code for this page: examples/SwtApp-3.

Next page: Create SWT library and use it in SWT app.

Clone this wiki locally