From: Ben Soares Date: Mon, 23 Sep 2019 08:14:53 +0000 (+0100) Subject: JAL-3210 First commit for goomph powered jalviewjs build X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=76494f350ba7b56f2a463f88dfba04628fb6a58b;p=jalview.git JAL-3210 First commit for goomph powered jalviewjs build --- diff --git a/build.gradle b/build.gradle index 5ceb4fa..e6430f1 100644 --- a/build.gradle +++ b/build.gradle @@ -3,14 +3,51 @@ import org.gradle.internal.os.OperatingSystem import org.gradle.plugins.ide.eclipse.model.* import groovy.transform.ExternalizeMethods - plugins { id 'java' id 'application' id 'eclipse' id 'com.diffplug.gradle.oomph.ide' version '3.18.0' + id 'com.diffplug.gradle.equinoxlaunch' version '3.18.0' + + id 'com.diffplug.gradle.p2.asmaven' version '3.18.0' +} + + + +def eclipseDeps = [ +/* + // The dependencies we actually use + 'org.eclipse.jdt.core', + 'org.eclipse.text', + + // Their transitives + 'org.eclipse.core.contenttype', + 'org.eclipse.core.jobs', + 'org.eclipse.core.runtime', + 'org.eclipse.core.resources', + 'org.eclipse.equinox.common', + 'org.eclipse.equinox.preferences', +*/ + 'org.eclipse.osgi' +] + +p2AsMaven { + group 'p2', { + repoEclipse goomph_eclipse_version + eclipseDeps.each { p2.addIU(it) } + eclipseDeps.each { p2.addIU(it + '.source') } + } } +dependencies { + eclipseDeps.each { compile "p2:${it}:+" } +} + + + + + repositories { jcenter() mavenCentral() @@ -216,6 +253,88 @@ clean { } */ + + + + + + + + + + +oomphIde { + repoEclipse goomph_eclipse_version + jdt { + /* + installedJre { + //markDefault = true + //executionEnvironments = [ eclipse.jdt.javaRuntimeName ] + } + */ + //compilerComplianceLevel( JAVA_INTEGER_VERSION ) + } + //repo 'http://download.eclipse.org/buildship/updates/e45/milestones/3.x/' + repo goomph_repo_buildship + feature goomph_feature_buildship +} + +equinoxLaunch { + headlessAppSetup { + launchTask 'ideJalviewjsBuild', { + //it.args = ["-nosplash", "--launcher.suppressErrors", "-application", "org.eclipse.jdt.apt.core.aptBuild", "-data", tempEclipseWorkspace, "-"+jalviewjs_eclipseBuildArg, eclipse_project_name ] + it.args = ["-nosplash", "--launcher.suppressErrors", "-application", "org.eclipse.jdt.apt.core.aptBuild", "-"+jalviewjs_eclipseBuildArg, eclipse_project_name ] + } + } +} + +task ideCopyDropins (type: Copy) { + dependsOn ideSetupP2 + + def inputFiles = fileTree(jalviewjs_utils_dir+"/"+jalviewjs_eclipse_dropins_dir) + def outputDir = oomphIde.ideDir + "/" + com.diffplug.gradle.FileMisc.macContentsEclipse() + "/dropins" + + from inputFiles + into outputDir + def outputFiles = [] + rename { filename -> + outputFiles += outputDir+"/"+filename + println("COPYING ${filename} to ${outputFiles}") + null + } + outputs.files outputFiles + inputs.files inputFiles + +} + +ide.dependsOn ideCopyDropins +ideJalviewjsBuild.dependsOn ideSetupWorkspace +ideJalviewjsBuild.dependsOn ideCopyDropins + + + + + + + + + + + + + + +def tempEclipseWorkspace = "" + +task jalviewjsSetTempEclipseWorkspace { + tempEclipseWorkspace = file(jalviewjs_eclipse_workspace) + if (!tempEclipseWorkspace.exists()) { + tempEclipseWorkspace = File.createTempDir() + tempEclipseWorkspace.deleteOnExit() + } + println("ECLIPSE WORKSPACE: "+tempEclipseWorkspace.getPath()) +} + task jalviewjsUnzipFiles { def zipFiles = fileTree(dir: jalviewjs_utils_dir+"/"+jalviewjs_libjs_dir).include("*.zip") zipFiles += jalviewjs_utils_dir+"/"+jalviewjs_swingjs_zip @@ -290,25 +409,6 @@ task jalviewjsEclipseCopyPlugins (type: Copy) { inputs.files inputFiles } -def tempEclipseWorkspace = "" - -task jalviewjsSetTempEclipseWorkspace { - tempEclipseWorkspace = file(jalviewjs_eclipse_workspace) - if (!tempEclipseWorkspace.exists()) { - tempEclipseWorkspace = File.createTempDir() - tempEclipseWorkspace.deleteOnExit() - } - println("ECLIPSE WORKSPACE: "+tempEclipseWorkspace.getPath()) -} - -oomphIde { - repoEclipseLatest() - jdt { - } - repo 'http://download.eclipse.org/buildship/updates/e45/milestones/3.x/' - feature 'org.eclipse.buildship' -} - task jalviewjsEclipseSetup { dependsOn jalviewjsEclipseCopyDropins dependsOn jalviewjsEclipseCopyPlugins diff --git a/gradle.properties b/gradle.properties index b465af2..9b82d59 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ jalviewDir = . -#JAVA_VERSION = 1.8 -JAVA_VERSION = 11 +JAVA_VERSION = 1.8 +#JAVA_VERSION = 11 JALVIEW_VERSION = DEVELOPMENT INSTALLATION = Source @@ -76,3 +76,7 @@ j2s.class.replacements = org.apache.log4j.->jalview.javascript.log4j. #otherwise, only the first call to a method will be logged #output will be comma-separated: called method,caller class #j2s.prop.j2s.log.all.calls=true + +goomph_eclipse_version = 4.12 +goomph_repo_buildship = https://download.eclipse.org/buildship/updates/e47/releases/3.x/ +goomph_feature_buildship = org.eclipse.buildship