Skip to content

Commit

Permalink
Merge pull request #29 from jazz-community/6.0.6.1-support
Browse files Browse the repository at this point in the history
Version 2.1
  • Loading branch information
SBI- authored Jun 25, 2019
2 parents e3181b8 + b7ccb63 commit 116a35c
Show file tree
Hide file tree
Showing 38 changed files with 3,345 additions and 50 deletions.
116 changes: 106 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,34 +1,125 @@
import com.github.sherter.googlejavaformatgradleplugin.GoogleJavaFormat
import org.jazzcommunity.development.BackupTask
import org.jazzcommunity.development.BootStrapTask
import org.jazzcommunity.development.DeploymentTask
import org.jazzcommunity.development.FinalizeTask
import org.jazzcommunity.development.InitializeTask
import org.jazzcommunity.development.P2CreationTask
import org.jazzcommunity.development.P2ProfileTask
import org.jazzcommunity.development.RunTask
import org.jazzcommunity.development.SetupTask
import org.jazzcommunity.development.InfoTask
import org.jazzcommunity.development.UpgradeTask
import org.jazzcommunity.development.library.DetectOperatingSystem
import org.jazzcommunity.development.library.FileTools
import org.jazzcommunity.development.library.RuntimeDetector
import org.jazzcommunity.development.library.config.ConfigReader

plugins {
id 'java-gradle-plugin'
id 'com.github.sherter.google-java-format' version '0.7.1'
id 'com.diffplug.gradle.equinoxlaunch'
id 'com.diffplug.gradle.oomph.ide'
}

dependencies {
compile 'com.diffplug.gradle:goomph:3.17.4'
}

repositories {
jcenter()
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
}

oomphIde {
repoEclipseLatest()
splash 'buildSrc/resources/logo.png'

/*
* When debugging plugins for the goomph generated environment, it really helps when you:
* 1. launch the ide using gradlew run
* 2. wait until eclipse has loaded and close the application
* 3. (manually deploy whatever plugin you need if not added here yet)
* 4. use https://stackoverflow.com/questions/1489648/eclipse-doesnt-load-plugins-in-the-dropins-folder
* to get full debug information of plugin deployment
*/

// Use legacy GEF (up to 4.0.0) because the new releases don't have the required
// org.eclipse.draw2d and org.eclipse.gef bundles for feature based launches anymore.
repo 'https://download.eclipse.org/tools/gef/updates/legacy/releases/4.0.0_gef-master_1952'
feature 'org.eclipse.gef'

pde {
targetplatform 'ibm-sdk', {
it.installation project.hasProperty("sdk")
// TODO: Keep verifying that these work. Seems to be the case so far.
? FileTools.toAbsolute("jde/runtime/$sdk/sdk").path
: RuntimeDetector.getTargetPlatform(project)
}
}

// add the custom launches for creating required runtime files for a new release
if (FileTools.exists('jde/dev/launches')) {
addProjectFolder 'jde/dev/launches'
}

// Example for how to load proxy settings. Most likely, this should be stored to the
// user folder folder as a template, and only be loaded if it exists with content.
// Or something like that.
// p2director {
// addArg('plugincustomization', 'tool/fiddler-proxy.ini')
// }

// adding these features doesn't work because eclipse and the p2 repository have dependency
// collisions. Otherwise, manual importing of the common.tests.utils plugin would not be
// necessary.
// Maybe finding the eclipse version with matching plugins could work, which is why this is
// left here for documentation purposes
// repo FileTools.toAbsolute('jde/p2repo/6.0.6')
// feature 'com.ibm.team.repository.services.jfs.feature'
// feature 'com.ibm.team.repository.services.tests.jfs.feature'
// feature 'com.ibm.team.common.tests.utils.feature'
}

task format(type: GoogleJavaFormat) {
group = "jde development"
description = "Format jde source code according to the google code style."
task initialize(type: InitializeTask) {
dependsOn ideClean
dependsOn ideSetupP2
dependsOn ideSetupWorkspace
// make sure initialize always creates exactly one workspace, this makes dealing with
// identical files in the finalize task far easier
tasks.findByName('ideSetupP2').mustRunAfter('ideClean')
tasks.findByName('ideSetupWorkspace').mustRunAfter('ideSetupP2')
finalizedBy ide
}

googleJavaFormat {
group = "jde development"
description = "Source folders to include in formatting."
include 'buildSrc/**'
task packageDatabase(type: Zip) {
from 'jde/dev/db'
include '**/*'
archiveName FileTools.newestVersion('jde/sdks') + '_db.zip'
destinationDir(file('jde/dev'))
}

task finalize(type: FinalizeTask) {
// maybe find a way to just ignore this task if initialize hasn't been run
dependsOn packageDatabase
}

task p2create(type: P2CreationTask) {
dependsOn ideSetupP2
sdk = ""
}

task p2use(type: P2ProfileTask) {
sdk = ""
out = "file"
create = "false"
}

//// TODO: Planned for next release
//task deploy(type: DeploymentTask) {
// group = ""
// description = ""
//}

task bootstrap(type: BootStrapTask) {
group = "Jazz Development Environment"
description = "Create folders for user environment. Generally only needs to be run once."
Expand All @@ -53,6 +144,11 @@ task setup(type: SetupTask) {
sdk = ""
}

task upgrade(type: UpgradeTask) {
group = "Jazz Development Environment"
description = "Copies all non-user files after upgrading from an older jazz development environment"
}

allprojects {
afterEvaluate { project ->
def runtime = RuntimeDetector.get(project)
Expand All @@ -75,4 +171,4 @@ allprojects {
}

}
}
}
73 changes: 73 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import com.github.sherter.googlejavaformatgradleplugin.GoogleJavaFormat

plugins {
id 'java-gradle-plugin'
id 'org.openrepose.gradle.plugins.jaxb' version '2.5.0'
id 'com.github.sherter.google-java-format' version '0.7.1'
}

dependencies {
Expand All @@ -9,14 +13,83 @@ dependencies {
compile group: 'org.tukaani', name: 'xz', version: '1.8'
compile group: 'com.google.guava', name: 'guava', version: '26.0-jre'
compile "org.jtwig:jtwig-core:5.87.0.RELEASE"
// jaxb for xsd -> class generation
jaxb 'org.glassfish.jaxb:jaxb-xjc:2.2.11'
jaxb 'org.glassfish.jaxb:jaxb-runtime:2.2.11'
jaxb "org.jvnet.jaxb2_commons:jaxb2-basics:1.11.1"
jaxb 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:1.11.1'
jaxb 'org.jvnet.jaxb2_commons:jaxb2-basics-annotate:1.0.4'
// required as a dependency for avoiding logging erros from jaxb
jaxb 'org.slf4j:slf4j-log4j12:1.7.25'
// eclipse plugin
compile 'com.diffplug.gradle:goomph:3.17.4'
// issues with removed xml namespace
// Yes, these have to both be in here! Once for actually using
// the generated classes in the build source
compile group: 'javax.activation', name: 'activation', version: '1.1.1'
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.1'
compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.1'
compile group: 'javax.activation', name: 'javax.activation-api', version: '1.2.0'
// and once so that the xjc task can find them on its class path.
// haven't found a better way for this
jaxb 'javax.activation:activation:1.1.1'
jaxb 'javax.xml.bind:jaxb-api:2.1'
jaxb 'org.glassfish.jaxb:jaxb-runtime:2.3.1'
jaxb 'javax.activation:javax.activation-api:1.2.0'
}

repositories {
jcenter()
mavenCentral()
}

sourceSets {
main {
java {
exclude 'jde'
java.srcDir 'build/generated-sources/xjc'
}
}
}

googleJavaFormat {
group = "jde development"
description = "Source folders to include in formatting."
source 'buildSrc'
}

task format(type: GoogleJavaFormat) {
group = "jde development"
description = "Format jde source code according to the google code style."
}

compileJava {
dependsOn format
}

tasks.withType(JavaCompile) {
//options.compilerArgs += ["--add-modules", "java.xml.bind,java.activation"]
options.compilerArgs << "-Xlint:unchecked"
options.deprecation = true
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}

jaxb {
xsdDir = "resources/"
xjc {
generateEpisodeFiles = false
taskClassname = "org.jvnet.jaxb2_commons.xjc.XJC2Task"
generatePackage = "org.jazzcommunity.development.gen"
args = ["-Xinheritance", "-Xannotate"]
}
}

compileJava {
// doFirst {
// options.compilerArgs += ["--add-modules", "java.xml.bind,java.activation"]
// }
dependsOn clean
dependsOn xjc
tasks.findByName('xjc').mustRunAfter('clean')
}
Binary file added buildSrc/resources/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 116a35c

Please sign in to comment.