├── .gitignore
├── .project
├── .settings
└── org.eclipse.buildship.core.prefs
├── .travis.yml
├── LICENSE
├── README.md
├── artifactoryupload
├── .classpath
├── .project
├── .settings
│ ├── org.eclipse.buildship.core.prefs
│ └── org.eclipse.jdt.groovy.core.prefs
├── build.gradle
└── src
│ └── main
│ ├── groovy
│ └── de
│ │ └── monkeyworks
│ │ └── buildmonkey
│ │ └── ArtifactoryUploadPlugin.groovy
│ └── resources
│ ├── META-INF
│ └── gradle-plugins
│ │ └── de.monkeyworks.buildmonkey.ArtifactoryUploadPlugin.properties
│ └── executables
│ ├── jfrog
│ ├── jfrog-linux
│ └── jfrog-windows.exe
├── base
├── .classpath
├── .project
├── .settings
│ ├── org.eclipse.buildship.core.prefs
│ └── org.eclipse.jdt.groovy.core.prefs
├── build.gradle
└── src
│ ├── main
│ └── groovy
│ │ └── de
│ │ └── monkeyworks
│ │ └── buildmonkey
│ │ ├── eclipsesdk
│ │ ├── DownloadHelper.groovy
│ │ ├── EclipseConfiguration.groovy
│ │ ├── tools
│ │ │ └── DownloadEclipseSdkTask.groovy
│ │ └── utils
│ │ │ └── FileSemaphore.groovy
│ │ └── osgi
│ │ ├── ManifestParser.groovy
│ │ └── RequiredBundle.java
│ └── test
│ └── groovy
│ └── de
│ └── monkeyworks
│ └── buildmonkey
│ └── osgi
│ └── test
│ └── ManifestParserTest.groovy
├── build.gradle
├── compilation
├── .classpath
├── .project
├── .settings
│ ├── org.eclipse.buildship.core.prefs
│ └── org.eclipse.jdt.groovy.core.prefs
├── gradle.dependency
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ │ ├── org.eclipse.buildship.core.prefs
│ │ └── org.eclipse.jdt.groovy.core.prefs
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── groovy
│ │ └── de
│ │ │ └── monkeyworks
│ │ │ └── buildmonkey
│ │ │ └── dependency
│ │ │ ├── DependencyBundle.groovy
│ │ │ └── ManifestDependencyPlugin.groovy
│ │ └── resources
│ │ └── META-INF
│ │ └── gradle-plugins
│ │ └── de.monkeyworks.buildmonkey.ManifestDependencyPlugin.properties
└── gradle.projectsetup
│ ├── build.gradle
│ └── src
│ └── main
│ ├── groovy
│ └── de
│ │ └── monkeyworks
│ │ └── buildmonkey
│ │ └── projectsetup
│ │ ├── FixDependencyVersion.groovy
│ │ └── ProjectSetupPlugin.groovy
│ └── resources
│ └── META-INF
│ └── gradle-plugins
│ ├── de.monkeyworks.buildmonkey.FixDependencyVersion.properties
│ └── de.monkeyworks.buildmonkey.ProjectSetupPlugin.properties
├── docs
└── images
│ └── compilation_architecture.png
├── examples
├── example1
│ ├── .project
│ ├── .settings
│ │ └── org.eclipse.buildship.core.prefs
│ ├── MonkeyPlugin
│ │ ├── .classpath
│ │ ├── .project
│ │ ├── .settings
│ │ │ ├── org.eclipse.buildship.core.prefs
│ │ │ └── org.eclipse.jdt.core.prefs
│ │ ├── META-INF
│ │ │ └── MANIFEST.MF
│ │ ├── build.properties
│ │ ├── plugin.xml
│ │ ├── resources
│ │ │ └── icons
│ │ │ │ └── monkey.png
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── de
│ │ │ └── monkeyworks
│ │ │ └── plugins
│ │ │ └── monkeyplugin
│ │ │ └── MonkeyHandler.java
│ ├── build.gradle
│ ├── build.sh
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── helloBuildMonkey.target
│ └── settings.gradle
├── exampleApp
│ ├── .project
│ ├── .settings
│ │ └── org.eclipse.buildship.core.prefs
│ ├── MonkeyExampleE4Application
│ │ ├── .classpath
│ │ ├── .project
│ │ ├── .settings
│ │ │ ├── org.eclipse.buildship.core.prefs
│ │ │ └── org.eclipse.jdt.core.prefs
│ │ ├── Application.e4xmi
│ │ ├── META-INF
│ │ │ └── MANIFEST.MF
│ │ ├── MonkeyExcampleE4Application.product
│ │ ├── build.gradle
│ │ ├── build.properties
│ │ ├── css
│ │ │ └── default.css
│ │ ├── dep.txt
│ │ ├── icons
│ │ │ ├── sample.png
│ │ │ └── save_edit.png
│ │ ├── plugin.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── examplee4application
│ │ │ ├── handlers
│ │ │ ├── AboutHandler.java
│ │ │ ├── OpenHandler.java
│ │ │ ├── QuitHandler.java
│ │ │ └── SaveHandler.java
│ │ │ └── parts
│ │ │ └── SamplePart.java
│ ├── MonkeyHandlerPlugin
│ │ ├── .classpath
│ │ ├── .project
│ │ ├── .settings
│ │ │ ├── org.eclipse.buildship.core.prefs
│ │ │ └── org.eclipse.jdt.core.prefs
│ │ ├── META-INF
│ │ │ └── MANIFEST.MF
│ │ ├── build.gradle
│ │ ├── build.properties
│ │ ├── fragment.e4xmi
│ │ ├── plugin.xml
│ │ ├── resources
│ │ │ └── icons
│ │ │ │ └── monkey.png
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── de
│ │ │ └── monkeyworks
│ │ │ └── plugins
│ │ │ └── monkeyhandlerplugin
│ │ │ ├── MonkeyHandler.java
│ │ │ └── Text.java
│ ├── build.gradle
│ ├── build.sh
│ ├── exampleE4App.target
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
└── exampleM2
│ ├── build.gradle
│ ├── build.sh
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradlew
│ └── gradlew.bat
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── materialisation
├── gradle.pde
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── groovy
│ │ └── de
│ │ │ └── monkeyworks
│ │ │ └── buildmonkey
│ │ │ └── pde
│ │ │ ├── BundlePlugin.groovy
│ │ │ ├── Config.groovy
│ │ │ ├── PluginTestPlugin.groovy
│ │ │ ├── PluginUtils.groovy
│ │ │ ├── TestDefinitionPlugin.groovy
│ │ │ ├── UITestDefinitionPlugin.groovy
│ │ │ ├── UiTestPlugin.groovy
│ │ │ ├── mavenize
│ │ │ ├── Bundle2Pom.groovy
│ │ │ ├── BundleMavenDeployer.groovy
│ │ │ ├── DependencyBundle.groovy
│ │ │ ├── DeployMavenAntTaskExecutor.groovy
│ │ │ ├── Pom.groovy
│ │ │ └── Version.groovy
│ │ │ ├── testing
│ │ │ ├── PluginTestClassScanner.java
│ │ │ ├── PluginTestExecuter.java
│ │ │ ├── PluginTestExtension.java
│ │ │ ├── PluginTestListener.java
│ │ │ ├── PluginTestPortLocator.java
│ │ │ ├── PluginTestRunnerClient.java
│ │ │ ├── UiTestExecuter.java
│ │ │ └── UiTestExtension.java
│ │ │ ├── tools
│ │ │ ├── DownloadApplicationTask.groovy
│ │ │ ├── DownloadEclipseSdkTask.groovy
│ │ │ └── FileHelper.groovy
│ │ │ └── utils
│ │ │ └── FileSemaphore.groovy
│ │ └── resources
│ │ └── META-INF
│ │ └── gradle-plugins
│ │ ├── de.monkeyworks.buildmonkey.pde.PluginTestPlugin.properties
│ │ ├── de.monkeyworks.buildmonkey.pde.TestDefinitionPlugin.properties
│ │ ├── de.monkeyworks.buildmonkey.pde.UITestDefinitionPlugin.properties
│ │ └── de.monkeyworks.buildmonkey.pde.UiTestPlugin.properties
└── product
│ └── src
│ └── main
│ ├── groovy
│ └── de
│ │ └── monkeyworks
│ │ └── buildmonkey
│ │ └── product
│ │ └── publish
│ │ ├── ProductExtension.groovy
│ │ └── ProductPublishPlugin.groovy
│ └── resources
│ └── META-INF
│ └── gradle-plugins
│ └── de.monkeyworks.buildmonkey.ProductPublishPlugin.properties
├── osgi
└── manifestUpdater
│ ├── build.gradle
│ └── src
│ └── main
│ ├── groovy
│ └── de
│ │ └── monkeyworks
│ │ └── buildmonkey
│ │ └── osgi
│ │ ├── ManifestUpdater.groovy
│ │ └── ManifestUpdaterExtension.groovy
│ └── resources
│ └── META-INF
│ └── gradle-plugins
│ └── de.monkeyworks.buildmonkey.osgi.ManifestUpdater.properties
├── repository
├── .classpath
├── .project
├── .settings
│ ├── org.eclipse.buildship.core.prefs
│ └── org.eclipse.jdt.groovy.core.prefs
├── gradle.mavenize
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ │ ├── org.eclipse.buildship.core.prefs
│ │ └── org.eclipse.jdt.groovy.core.prefs
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── groovy
│ │ └── de
│ │ │ └── monkeyworks
│ │ │ └── buildmonkey
│ │ │ └── mavenizer
│ │ │ ├── MavenizerPlugin.groovy
│ │ │ └── mavenize
│ │ │ ├── Bundle2Pom.groovy
│ │ │ ├── BundleMavenDeployer.groovy
│ │ │ ├── DependencyBundle.groovy
│ │ │ ├── DeployMavenAntTaskExecutor.groovy
│ │ │ ├── Feature2Pom.groovy
│ │ │ ├── Pom.groovy
│ │ │ └── Version.groovy
│ │ └── resources
│ │ └── META-INF
│ │ └── gradle-plugins
│ │ └── de.monkeyworks.buildmonkey.mavenizer.MavenizerPlugin.properties
├── gradle.p2
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ │ ├── org.eclipse.buildship.core.prefs
│ │ └── org.eclipse.jdt.groovy.core.prefs
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── groovy
│ │ └── de
│ │ │ └── monkeyworks
│ │ │ └── buildmonkey
│ │ │ └── p2
│ │ │ └── P2MirrorPlugin.groovy
│ │ └── resources
│ │ └── META-INF
│ │ └── gradle-plugins
│ │ └── de.monkeyworks.buildmonkey.p2.P2MirrorPlugin.properties
├── gradle.p2publish
│ ├── .classpath
│ ├── .gradletasknamecache
│ ├── .project
│ ├── .settings
│ │ ├── org.eclipse.buildship.core.prefs
│ │ └── org.eclipse.jdt.groovy.core.prefs
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── groovy
│ │ └── de
│ │ │ └── monkeyworks
│ │ │ └── buildmonkey
│ │ │ └── p2
│ │ │ └── deployer
│ │ │ ├── P2DeployerPlugin.groovy
│ │ │ ├── P2DeploymentExtension.groovy
│ │ │ └── util
│ │ │ └── FeatureHelper.groovy
│ │ └── resources
│ │ └── META-INF
│ │ └── gradle-plugins
│ │ └── de.monkeyworks.buildmonkey.p2.P2DeployerPlugin.properties
└── mavenArtefacts
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ ├── org.eclipse.buildship.core.prefs
│ └── org.eclipse.jdt.groovy.core.prefs
│ ├── build.gradle
│ └── src
│ └── main
│ ├── groovy
│ └── de
│ │ └── monkeyworks
│ │ └── buildmonkey
│ │ └── mavenizer
│ │ ├── MavenArtefactsExtension.groovy
│ │ └── MavenArtefactsPlugin.groovy
│ └── resources
│ └── META-INF
│ └── gradle-plugins
│ └── de.monkeyworks.buildmonkey.maven.MavenArtefactsPlugin.properties
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | .gradle
3 | .DS_Store
4 | bin
5 |
6 | .idea/
7 | examples/exampleApp/product/
8 | BuildMonkey.iml
9 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | BuildMonkey
4 |
5 |
6 |
7 |
8 |
9 |
10 | org.eclipse.buildship.core.gradleprojectnature
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.arguments=
2 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
3 | connection.java.home=null
4 | connection.jvm.arguments=
5 | connection.project.dir=
6 | derived.resources=.gradle,build
7 | eclipse.preferences.version=1
8 | project.path=\:
9 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 |
3 | jdk:
4 | - oraclejdk8
5 |
6 | os:
7 | - linux
8 |
9 | branches:
10 | only:
11 | - master
12 |
13 | before_cache:
14 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
15 | - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
16 | cache:
17 | directories:
18 | - $HOME/.gradle/caches/
19 | - $HOME/.gradle/wrapper/
20 |
21 | script:
22 | - ./gradlew --refresh-dependencies clean assemble install && cd examples/example1 && ./gradlew clean build
23 |
24 | notifications:
25 | email:
26 | recipients:
27 | - michael.barth@monkey-works.de
28 | - johannes.tandler@monkey-works.de
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 the original author or authors.
2 | All rights reserved. This program and the accompanying materials
3 | are made available under the terms of the Eclipse Public License v1.0
4 | which accompanies this distribution, and is available at
5 | http://www.eclipse.org/legal/epl-v10.html
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Attention
2 | During the last 2 years the MONKEY WORKS GmbH was integrated into the Elco Industrie Automation GmbH and changing the focus of development. Therefore we switched to GoLang and don't use Gradle - Eclipse anymore. We have no resources to support this project any longer. There are some forks, so it seems, that some of you want to proceed with this project. If it is so, then please contact me at m.barth@elco-automation.de and I will grant you to the project as lead. I really hope, that this project becomes a success.
3 |
4 | Sincerly
5 |
6 | Michael Barth
7 |
8 | # BuildMonkey
9 | [](https://travis-ci.org/MONKEY-WORKS/BuildMonkey)
10 |
11 | Build artefacts for creating an Eclipse RCP application with gradle.
12 |
13 | You can contact us per Gitter: https://gitter.im/BuildMonkeys
14 |
15 | Find the documentation here: https://github.com/MONKEY-WORKS/BuildMonkey/wiki
16 |
17 | # Subprojects
18 | ## Gradle artifact deployer
19 |
20 | A tool to easify uploading of generic artifacts to artifactory repositories.
21 |
22 | ## Gradle build
23 |
24 | A plugin to use the Manifest.MF of eclipse plugins for gradle dependency resolution. So no additional modification of `build.gradle` files anymore.
25 |
26 | ## Gradle p2
27 |
28 | Transformation between m2 (maven) and p2 (eclipse world) repositories made easy.
29 |
30 | ## Gradle pde
31 |
32 | Plugin to materialize eclipse rcp based products and execute eclipse plugin tests.
33 |
--------------------------------------------------------------------------------
/artifactoryupload/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/artifactoryupload/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | artifactoryupload
4 | Project artifactoryupload created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 | org.eclipse.jdt.groovy.core.groovyNature
17 | org.eclipse.jdt.core.javanature
18 |
19 |
20 |
--------------------------------------------------------------------------------
/artifactoryupload/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | build.commands=org.eclipse.jdt.core.javabuilder
2 | connection.arguments=
3 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
4 | connection.java.home=null
5 | connection.jvm.arguments=
6 | connection.project.dir=..
7 | containers=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/
8 | derived.resources=.gradle,build
9 | eclipse.preferences.version=1
10 | natures=org.eclipse.jdt.groovy.core.groovyNature,org.eclipse.jdt.core.javanature
11 | project.path=\:artifactoryupload
12 |
--------------------------------------------------------------------------------
/artifactoryupload/.settings/org.eclipse.jdt.groovy.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | groovy.compiler.level=24
3 |
--------------------------------------------------------------------------------
/artifactoryupload/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | maven {
4 | url "https://plugins.gradle.org/m2/"
5 | }
6 | }
7 | dependencies {
8 | classpath "com.gradle.publish:plugin-publish-plugin:0.9.7"
9 | }
10 | }
11 |
12 | apply plugin: 'groovy'
13 | apply plugin: 'maven-publish'
14 | apply plugin: 'maven'
15 |
16 | repositories {
17 | mavenCentral()
18 | }
19 |
20 | dependencies {
21 | compile gradleApi()
22 | compile localGroovy()
23 |
24 | compile 'org.apache.maven:maven-ant-tasks:2.1.3'
25 | compile 'org.eclipse.platform:org.eclipse.osgi:3.12.0'
26 | }
27 |
28 | apply plugin: "com.gradle.plugin-publish"
29 | version '0.4.3'
30 |
31 | pluginBundle {
32 | website = 'https://github.com/MONKEY-WORKS/BuildMonkey/wiki'
33 | vcsUrl = 'https://github.com/MONKEY-WORKS/BuildMonkey'
34 | description = 'Publishs folder structures at an Artifactory server'
35 | tags = ['artifactory', 'publish', 'gradle']
36 |
37 | plugins {
38 | artifactoryUploadPlugin {
39 | id = 'de.monkeyworks.buildmonkey.ArtifactoryUploadPlugin'
40 | displayName = 'Artifactory Upload plugin'
41 | }
42 | }
43 |
44 | mavenCoordinates {
45 | groupId = "de.monkeyworks.buildmonkey"
46 | }
47 |
48 | }
--------------------------------------------------------------------------------
/artifactoryupload/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.ArtifactoryUploadPlugin.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 the original author or authors.
3 | # All rights reserved. This program and the accompanying materials
4 | # are made available under the terms of the Eclipse Public License v1.0
5 | # which accompanies this distribution, and is available at
6 | # http://www.eclipse.org/legal/epl-v10.html
7 | #
8 |
9 | implementation-class=de.monkeyworks.buildmonkey.ArtifactoryUploadPlugin
10 |
--------------------------------------------------------------------------------
/artifactoryupload/src/main/resources/executables/jfrog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MONKEY-WORKS/BuildMonkey/a0deaf33613036af8d8561dc9f63540cb5887998/artifactoryupload/src/main/resources/executables/jfrog
--------------------------------------------------------------------------------
/artifactoryupload/src/main/resources/executables/jfrog-linux:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MONKEY-WORKS/BuildMonkey/a0deaf33613036af8d8561dc9f63540cb5887998/artifactoryupload/src/main/resources/executables/jfrog-linux
--------------------------------------------------------------------------------
/artifactoryupload/src/main/resources/executables/jfrog-windows.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MONKEY-WORKS/BuildMonkey/a0deaf33613036af8d8561dc9f63540cb5887998/artifactoryupload/src/main/resources/executables/jfrog-windows.exe
--------------------------------------------------------------------------------
/base/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/base/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | base
4 | Project base created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 | org.eclipse.jdt.groovy.core.groovyNature
17 | org.eclipse.jdt.core.javanature
18 |
19 |
20 |
--------------------------------------------------------------------------------
/base/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | build.commands=org.eclipse.jdt.core.javabuilder
2 | connection.arguments=
3 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
4 | connection.java.home=null
5 | connection.jvm.arguments=
6 | connection.project.dir=..
7 | containers=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/
8 | derived.resources=.gradle,build
9 | eclipse.preferences.version=1
10 | natures=org.eclipse.jdt.groovy.core.groovyNature,org.eclipse.jdt.core.javanature
11 | project.path=\:base
12 |
--------------------------------------------------------------------------------
/base/.settings/org.eclipse.jdt.groovy.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | groovy.compiler.level=24
3 |
--------------------------------------------------------------------------------
/base/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.jfrog.bintray'
2 | apply plugin: 'java'
3 |
4 | version = '1.0.4'
5 | group = 'de.monkeyworks.buildmonkey'
6 |
7 | publishing {
8 | publications {
9 | mavenGroovy(MavenPublication) {
10 | from components.java
11 | artifact sourcesJar
12 | artifact groovydocJar
13 | groupId "${group}"
14 | artifactId 'base'
15 | version project.version
16 | pom.withXml {
17 | def root = asNode()
18 | root.appendNode('description', 'Common tasks and classes for the BuildMonkey project')
19 | root.appendNode('name', 'base')
20 | root.appendNode('url', 'https://github.com/MONKEY-WORKS/BuildMonkey/tree/master/base')
21 | }
22 | }
23 | }
24 | }
25 |
26 | task sourcesJar(type: Jar) {
27 | from sourceSets.main.groovy.srcDirs
28 | classifier = 'sources'
29 | }
30 |
31 |
32 | task groovydocJar(type: Jar, dependsOn: groovydoc) {
33 | classifier = 'groovydoc'
34 | from javadoc.destinationDir
35 | // options.encoding = 'UTF-8'
36 | }
37 |
38 | artifacts {
39 | archives groovydocJar
40 | archives sourcesJar
41 | }
42 |
43 | Properties properties = new Properties()
44 | File propFile = "${System.properties['user.home']}${File.separator}.gradle${File.separator}bintray.properties" as File
45 | if(propFile.exists()) {
46 | properties.load(propFile.newDataInputStream())
47 |
48 |
49 | // Use gradle bintrayUpload for uploading.
50 | bintray {
51 | user = properties.getProperty("bintray.user")
52 | key = properties.getProperty("bintray.apikey")
53 | publications = ['mavenGroovy']
54 | pkg {
55 | repo = 'BuildMonkey'
56 | name = 'base'
57 | userOrg = 'monkey-works'
58 | licenses = ['EPL-1.0']
59 | vcsUrl = 'https://github.com/MONKEY-WORKS/BuildMonkey.git'
60 | version {
61 | name = project.version
62 | desc = 'Common tasks and classes for the BuildMonkey project'
63 | released = new Date()
64 | }
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/base/src/main/groovy/de/monkeyworks/buildmonkey/eclipsesdk/DownloadHelper.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.eclipsesdk
9 |
10 | import de.monkeyworks.buildmonkey.eclipsesdk.tools.DownloadEclipseSdkTask
11 | import org.gradle.api.Project
12 |
13 | /**
14 | * Created by Johannes Tandler on 24/02/2017.
15 | */
16 | class DownloadHelper {
17 |
18 | static final String TASK_NAME_DOWNLOAD_ECLIPSE_SDK = "downloadEclipseSdk"
19 | static final String ECLIPSE_CONFIGURATION_EXTENSION_NAME = "eclipseConfiguration"
20 |
21 | static void addEclipseConfigurationExtension(Project project) {
22 | if(project.extensions.findByName(ECLIPSE_CONFIGURATION_EXTENSION_NAME) == null) {
23 | project.extensions.create(ECLIPSE_CONFIGURATION_EXTENSION_NAME, EclipseConfiguration, project)
24 | }
25 | }
26 |
27 | static void addTaskDownloadEclipseSdk(Project project) {
28 | if (project.tasks.findByPath(TASK_NAME_DOWNLOAD_ECLIPSE_SDK) != null)
29 | return
30 |
31 | project.task(TASK_NAME_DOWNLOAD_ECLIPSE_SDK, type: DownloadEclipseSdkTask) {
32 | project.afterEvaluate {
33 | description = "Downloads an Eclipse SDK to perform P2 operations with."
34 |
35 | EclipseConfiguration config = project.eclipseConfiguration
36 |
37 | onlyIf {
38 | return !config.isDownloded()
39 | }
40 |
41 | def os = org.gradle.internal.os.OperatingSystem.current()
42 | def arch = System.getProperty("os.arch").contains("64") ? "-x86_64" : ""
43 | def eclipseUrl = config.eclipseSdkURL
44 | def eclipseVersion = config.eclipseVersion
45 |
46 | if (os.windows) {
47 | downloadUrl = "${eclipseUrl}/eclipse-SDK-${eclipseVersion}-win32${arch}.zip"
48 | } else if (os.macOsX) {
49 | downloadUrl = "${eclipseUrl}/eclipse-SDK-${eclipseVersion}-macosx-cocoa${arch}.tar.gz"
50 | } else if (os.linux) {
51 | downloadUrl = "${eclipseUrl}/eclipse-SDK-${eclipseVersion}-linux-gtk${arch}.tar.gz"
52 | }
53 |
54 | targetDir = project.buildDir.toPath().resolve("downloads").toFile()
55 | }
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/base/src/main/groovy/de/monkeyworks/buildmonkey/eclipsesdk/EclipseConfiguration.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.eclipsesdk
9 |
10 | import org.gradle.api.Project
11 |
12 | import java.nio.file.Files
13 | import java.nio.file.Path
14 | import java.nio.file.Paths
15 |
16 | /**
17 | * Created by Johannes Tandler on 24/02/2017.
18 | */
19 | class EclipseConfiguration {
20 |
21 | /**
22 | * download url of eclipse
23 | */
24 | def eclipseSdkURL
25 |
26 | /**
27 | * version of eclipse
28 | */
29 | def eclipseVersion
30 |
31 | /**
32 | * local eclipse directory
33 | */
34 | String localEclipseDir
35 |
36 | /**
37 | * Version number of org.eclipse.equinox.launcher
38 | */
39 | String launcherVersion
40 |
41 | EclipseConfiguration(Project project) {
42 | eclipseSdkURL = 'https://ftp.heanet.ie/mirrors/eclipse/eclipse/downloads/drops4/R-4.7-201706120950/'
43 | eclipseVersion = '4.7'
44 | localEclipseDir = project.buildDir.toPath().resolve("eclipsesdk")
45 |
46 | // if eclipse home variable is there use it
47 | def homeEnv = System.getenv()["ECLIPSE_HOME"]
48 | if(homeEnv != null && homeEnv.length() > 0) {
49 | localEclipseDir = Paths.get(homeEnv)
50 | }
51 |
52 | project.project.gradle.taskGraph.whenReady {
53 | if(launcherVersion != null) {
54 | return
55 | }
56 |
57 | findLauncherVersion()
58 | }
59 | }
60 |
61 | Path getPluginPath() {
62 | def os = org.gradle.internal.os.OperatingSystem.current()
63 | def eclipsePath = Paths.get(localEclipseDir)
64 | def basePath = eclipsePath.resolve("plugins/")
65 |
66 | if(os.isMacOsX()) {
67 | basePath = eclipsePath.resolve("Contents/Eclipse/plugins/")
68 | }
69 | return basePath
70 | }
71 |
72 | void findLauncherVersion() {
73 | if(!Files.exists(getPluginPath())) {
74 | return
75 | }
76 |
77 | def equinoxLaunchers = new FileNameFinder().getFileNames(getPluginPath().toAbsolutePath().toFile().toString(), 'org.eclipse.equinox.launcher_*.jar')
78 | assert equinoxLaunchers.size() > 0
79 |
80 | String tmp = equinoxLaunchers.get(0)
81 | tmp = tmp.substring(tmp.indexOf("org.eclipse.equinox.launcher_") + ("org.eclipse.equinox.launcher_").length())
82 | tmp = tmp.substring(0, tmp.indexOf(".jar"))
83 |
84 | launcherVersion = tmp
85 | }
86 |
87 | Path getLauncherPath() {
88 | if(launcherVersion == null) {
89 | findLauncherVersion()
90 | }
91 | return getPluginPath().resolve("org.eclipse.equinox.launcher_" + launcherVersion + ".jar")
92 | }
93 |
94 | boolean isDownloded() {
95 | return Files.exists(getLauncherPath())
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/base/src/main/groovy/de/monkeyworks/buildmonkey/eclipsesdk/tools/DownloadEclipseSdkTask.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.eclipsesdk.tools
9 |
10 | import de.monkeyworks.buildmonkey.eclipsesdk.EclipseConfiguration
11 | import de.monkeyworks.buildmonkey.eclipsesdk.utils.FileSemaphore
12 | import org.gradle.api.DefaultTask
13 | import org.gradle.api.Project
14 | import org.gradle.api.tasks.TaskAction
15 | import org.gradle.internal.os.OperatingSystem
16 |
17 | import java.nio.file.Files
18 | import java.nio.file.Path
19 | import java.nio.file.Paths
20 |
21 | class DownloadEclipseSdkTask extends DefaultTask {
22 |
23 | String downloadUrl
24 |
25 | File targetDir
26 |
27 | @TaskAction
28 | void downloadSdk() {
29 | // if multiple builds start on the same machine (which is the case with a CI server)
30 | // we want to prevent them downloading the same file to the same destination
31 | def directoryLock = new FileSemaphore(targetDir)
32 | directoryLock.lock()
33 | try {
34 | downloadEclipseSdkUnprotected(getProject())
35 | } finally {
36 | directoryLock.unlock()
37 | }
38 | }
39 |
40 | private void downloadEclipseSdkUnprotected(Project project) {
41 | // download the archive
42 | File sdkArchive = eclipseSdkArchive()
43 |
44 | EclipseConfiguration config = project.eclipseConfiguration
45 |
46 | // delete folder for extracted zip
47 | Path folder = sdkArchive.parentFile.toPath()
48 | def os = OperatingSystem.current()
49 | if(os.isMacOsX()) {
50 | folder = folder.resolve("Eclipse.app")
51 | } else {
52 | folder = folder.resolve("eclipse")
53 | }
54 | if(Files.exists(folder)) {
55 | folder.deleteDir()
56 | }
57 |
58 | project.logger.info("Download Eclipse SDK from '${downloadUrl}' to '${sdkArchive.absolutePath}'")
59 | project.ant.get(src: new URL(downloadUrl), dest: sdkArchive)
60 |
61 | // extract it to the same location where it was extracted
62 | project.logger.info("Extract '$sdkArchive' to '$sdkArchive.parentFile.absolutePath'")
63 | if (os.isWindows()) {
64 | project.ant.unzip(src: sdkArchive, dest: sdkArchive.parentFile, overwrite: true)
65 | } else {
66 | project.ant.untar(src: sdkArchive, dest: sdkArchive.parentFile, compression: "gzip", overwrite: true)
67 | }
68 |
69 | def targetEclipseDir = Paths.get(config.localEclipseDir)
70 | if(Files.exists(targetEclipseDir)) {
71 | targetEclipseDir.deleteDir()
72 | }
73 |
74 | Files.move(folder, Paths.get(config.localEclipseDir))
75 | }
76 |
77 | private File eclipseSdkArchive() {
78 | new File(targetDir, OperatingSystem.current().isWindows() ? 'eclipse-sdk.zip' : 'eclipse-sdk.tar.gz')
79 | }
80 | }
--------------------------------------------------------------------------------
/base/src/main/groovy/de/monkeyworks/buildmonkey/eclipsesdk/utils/FileSemaphore.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Donát Csikós (Gradle Inc.) - initial API and implementation and initial documentation
10 | */
11 | //DUPLICATED, must be part of a common bundle
12 | package de.monkeyworks.buildmonkey.eclipsesdk.utils
13 |
14 | import java.nio.channels.FileLock
15 |
16 | /**
17 | * Utility class for inter-process-synchronization by using a {@code FileLock} as a semaphore.
18 | *
19 | * When the {@link FileSemaphore#lock()} method is called, a .lock file is created under a given folder guarded by
20 | * the FileChannel.lock(). This lock can be released again by calling the {@link FileSemaphore#unlock()} method.
21 | */
22 | class FileSemaphore {
23 |
24 | final File directory
25 | FileOutputStream fos
26 | FileLock lock
27 |
28 | FileSemaphore(File directory) {
29 | this.directory = directory
30 | }
31 |
32 | def lock() {
33 | File lockFile = new File(directory, ".lock")
34 | if (!lockFile.exists()) {
35 | lockFile.getParentFile().mkdirs()
36 | lockFile.createNewFile()
37 | }
38 | fos = new FileOutputStream(lockFile)
39 | lock = fos.getChannel().lock()
40 | }
41 |
42 | def unlock() {
43 | lock.release()
44 | fos.close()
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/base/src/main/groovy/de/monkeyworks/buildmonkey/osgi/ManifestParser.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.osgi
9 |
10 | import java.util.jar.Manifest
11 |
12 | /**
13 | * Created by jake on 02.06.17.
14 | */
15 | class ManifestParser {
16 |
17 | protected File file
18 |
19 | protected Manifest manifest
20 |
21 | ManifestParser(File file) {
22 | this.file = file
23 | }
24 |
25 | ManifestParser(Manifest manifest) {
26 | this.manifest = manifest
27 | }
28 |
29 | def read() {
30 | if(manifest)
31 | return
32 |
33 | FileInputStream fis = new FileInputStream(file)
34 | manifest = new Manifest(fis)
35 | fis.close()
36 | }
37 |
38 | List parseRequireBundles() {
39 | if(!manifest) {
40 | read()
41 | }
42 |
43 | def requiredBundleString = manifest.getMainAttributes().getValue('Require-Bundle')
44 |
45 | List bundleStrings = []
46 |
47 | while(requiredBundleString != null && requiredBundleString.length() > 0) {
48 | if(!requiredBundleString.contains(",")) {
49 | bundleStrings.add(requiredBundleString)
50 | break
51 | }
52 |
53 |
54 | String bundle = requiredBundleString.substring(0, requiredBundleString.indexOf(","))
55 | requiredBundleString = requiredBundleString.substring(bundle.length())
56 |
57 | int quoteCount = countQuotes(bundle)
58 | while(quoteCount % 2 != 0) {
59 | int nextIndexOfComma = requiredBundleString.indexOf(",", 1)
60 | if(nextIndexOfComma == -1)
61 | nextIndexOfComma = requiredBundleString.length()
62 |
63 | bundle += requiredBundleString.substring(0, nextIndexOfComma)
64 | quoteCount = countQuotes(bundle)
65 |
66 | requiredBundleString = requiredBundleString.substring(nextIndexOfComma)
67 | }
68 |
69 | bundleStrings.add(bundle)
70 | if(requiredBundleString.length() == 0) {
71 | break
72 | }
73 |
74 | requiredBundleString = requiredBundleString.substring(1)
75 | }
76 |
77 | List result = []
78 | for(String bundleString : bundleStrings) {
79 | result.add(parseRequireBundle(bundleString))
80 | }
81 |
82 | return result
83 | }
84 |
85 | private int countQuotes(String txt) {
86 | return txt.length() - txt.replace("\"", "").length()
87 | }
88 |
89 | private RequiredBundle parseRequireBundle(String s) {
90 | RequiredBundle bundle = new RequiredBundle()
91 |
92 | if(!s.contains(";")) {
93 | bundle.bundleName = s
94 | return bundle
95 | }
96 |
97 | String[] sections = s.split(";")
98 | bundle.bundleName = sections[0]
99 | for(int i=1;i attributes = new HashMap<>();
19 |
20 | String bundleName;
21 |
22 | @Override
23 | public String toString() {
24 | StringBuilder builder = new StringBuilder();
25 |
26 | builder.append(bundleName);
27 | for(String key : attributes.keySet()) {
28 | builder.append(";");
29 | builder.append(key);
30 | builder.append("=\"");
31 | builder.append(attributes.get(key));
32 | builder.append("\"");
33 | }
34 |
35 | return builder.toString();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/base/src/test/groovy/de/monkeyworks/buildmonkey/osgi/test/ManifestParserTest.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.osgi.test
9 |
10 | import de.monkeyworks.buildmonkey.osgi.ManifestParser
11 | import org.junit.Test
12 |
13 | import static org.junit.Assert.*
14 |
15 | import java.util.jar.Manifest
16 |
17 | /**
18 | * Created by jake on 02.06.17.
19 | */
20 | class ManifestParserTest {
21 |
22 | @Test
23 | void testManifestParsing() {
24 | Manifest manifest = new Manifest()
25 | manifest.getMainAttributes().putValue("Require-Bundle", "bla,test,asd;bundle-version=\"1.4.0\",noob")
26 |
27 | ManifestParser parser = new ManifestParser(manifest)
28 |
29 | def requiredBundles = parser.parseRequireBundles()
30 |
31 | assertEquals("bundle should match", "bla", requiredBundles.get(0).bundleName)
32 | assertEquals("bundle should match", "test", requiredBundles.get(1).bundleName)
33 | assertEquals("bundle should match", "asd", requiredBundles.get(2).bundleName)
34 | assertEquals("bundle should match", "noob", requiredBundles.get(3).bundleName)
35 | }
36 |
37 | @Test
38 | void testManifestParsing2() {
39 | Manifest manifest = new Manifest()
40 | manifest.getMainAttributes().putValue("Require-Bundle", "test,asd;bundle-version=\"[1.4.0,]\",noob")
41 |
42 | ManifestParser parser = new ManifestParser(manifest)
43 |
44 | def requiredBundles = parser.parseRequireBundles()
45 |
46 | assertEquals("bundle should match", "test", requiredBundles.get(0).bundleName)
47 | assertEquals("bundle should match", "asd", requiredBundles.get(1).bundleName)
48 | assertEquals("bundle should match", "noob", requiredBundles.get(2).bundleName)
49 |
50 | assertTrue("dependency asd should containt version", requiredBundles.get(1).attributes.containsKey("bundle-version"))
51 | assertEquals("version was not derived correctly", "[1.4.0,]", requiredBundles.get(1).attributes.get("bundle-version"))
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | maven {
4 | url "https://plugins.gradle.org/m2/"
5 | }
6 | jcenter()
7 | }
8 |
9 | dependencies {
10 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
11 | classpath "com.gradle.publish:plugin-publish-plugin:0.9.7"
12 | classpath "gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.13.1"
13 | }
14 | }
15 |
16 | subprojects {
17 |
18 | group = "de.monkeyworks.buildmonkey"
19 | version = '0.4.1'
20 |
21 | apply plugin: 'groovy'
22 | apply plugin: 'maven-publish'
23 | apply plugin: 'maven'
24 | apply plugin: 'eclipse'
25 |
26 | group = "de.monkeyworks.buildmonkey"
27 |
28 |
29 | apply plugin: "com.github.hierynomus.license"
30 |
31 | license {
32 | header rootProject.file('LICENSE')
33 | strictCheck true
34 | skipExistingHeaders true
35 | }
36 |
37 | repositories {
38 | //mavenLocal()
39 | mavenCentral()
40 | jcenter()
41 | maven {
42 | url "http://dl.bintray.com/monkey-works/BuildMonkey"
43 | }
44 | }
45 |
46 | dependencies {
47 | compile gradleApi()
48 | compile localGroovy()
49 |
50 | testCompile 'junit:junit:4.12'
51 | }
52 | build.dependsOn install
53 |
54 |
55 | if(project.name != 'base') {
56 | publishing {
57 | publications {
58 | mavenGroovy(MavenPublication) {
59 | groupId "${group}"
60 | version project.version
61 | from components.java
62 | }
63 | }
64 | }
65 | }
66 |
67 | Properties properties = new Properties()
68 | File propFile = "${System.properties['user.home']}${File.separator}.gradle${File.separator}artifactory.properties" as File
69 | if(propFile.exists()) {
70 | properties.load(propFile.newDataInputStream())
71 | publishing {
72 | repositories {
73 | maven {
74 | name "artifactory"
75 | url "https://artifactory.monkey-works.de/artifactory/gradle-plugins"
76 | credentials {
77 | username properties.getProperty("artifactory.user")
78 | password properties.getProperty("artifactory.password")
79 | }
80 | }
81 | }
82 | }
83 | }
84 | }
85 |
86 |
87 |
--------------------------------------------------------------------------------
/compilation/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/compilation/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | compilation
4 | Project compilation created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 | org.eclipse.jdt.groovy.core.groovyNature
17 | org.eclipse.jdt.core.javanature
18 |
19 |
20 |
--------------------------------------------------------------------------------
/compilation/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | build.commands=org.eclipse.jdt.core.javabuilder
2 | connection.arguments=
3 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
4 | connection.java.home=null
5 | connection.jvm.arguments=
6 | connection.project.dir=..
7 | containers=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/
8 | derived.resources=.gradle,build
9 | eclipse.preferences.version=1
10 | natures=org.eclipse.jdt.groovy.core.groovyNature,org.eclipse.jdt.core.javanature
11 | project.path=\:compilation
12 |
--------------------------------------------------------------------------------
/compilation/.settings/org.eclipse.jdt.groovy.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | groovy.compiler.level=24
3 |
--------------------------------------------------------------------------------
/compilation/gradle.dependency/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/compilation/gradle.dependency/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | gradle.dependency
4 | Project gradle.dependency created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 | org.eclipse.jdt.groovy.core.groovyNature
17 | org.eclipse.jdt.core.javanature
18 |
19 |
20 |
--------------------------------------------------------------------------------
/compilation/gradle.dependency/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | build.commands=org.eclipse.jdt.core.javabuilder
2 | connection.arguments=
3 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
4 | connection.java.home=null
5 | connection.jvm.arguments=
6 | connection.project.dir=../..
7 | containers=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/
8 | derived.resources=.gradle,build
9 | eclipse.preferences.version=1
10 | natures=org.eclipse.jdt.groovy.core.groovyNature,org.eclipse.jdt.core.javanature
11 | project.path=\:compilation\:gradle.dependency
12 |
--------------------------------------------------------------------------------
/compilation/gradle.dependency/.settings/org.eclipse.jdt.groovy.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | groovy.compiler.level=24
3 |
--------------------------------------------------------------------------------
/compilation/gradle.dependency/build.gradle:
--------------------------------------------------------------------------------
1 |
2 | apply plugin: "com.gradle.plugin-publish"
3 |
4 | version = '0.4.13'
5 |
6 | dependencies {
7 | compile 'de.monkeyworks.buildmonkey:base:1.0.4'
8 | }
9 |
10 | pluginBundle {
11 | website = 'https://github.com/MONKEY-WORKS/BuildMonkey/wiki'
12 | vcsUrl = 'https://github.com/MONKEY-WORKS/BuildMonkey'
13 | description = 'Resolves dependencies from MANIFEST.MF files'
14 | tags = ['OSGi', 'build', 'MANIFEST', 'dependencies']
15 |
16 | plugins {
17 | manifestDependencyPlugin {
18 | id = 'de.monkeyworks.buildmonkey.ManifestDependencyPlugin'
19 | displayName = 'Dependencies from manifest plugin'
20 | }
21 | }
22 | mavenCoordinates {
23 | groupId = "de.monkeyworks.buildmonkey"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/compilation/gradle.dependency/src/main/groovy/de/monkeyworks/buildmonkey/dependency/DependencyBundle.groovy:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 Andrey Hihlovskiy
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | */
14 |
15 | package de.monkeyworks.buildmonkey.dependency
16 |
17 | import groovy.transform.ToString
18 |
19 | /**
20 | * POJO class holding data on dependency bundle. Used by {@link org.akhikhl.unpuzzle.osgi2maven.Pom} class.
21 | */
22 | @ToString
23 | public final class DependencyBundle {
24 | String group
25 | String name
26 | String version
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/compilation/gradle.dependency/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.ManifestDependencyPlugin.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 the original author or authors.
3 | # All rights reserved. This program and the accompanying materials
4 | # are made available under the terms of the Eclipse Public License v1.0
5 | # which accompanies this distribution, and is available at
6 | # http://www.eclipse.org/legal/epl-v10.html
7 | #
8 |
9 | implementation-class=de.monkeyworks.buildmonkey.dependency.ManifestDependencyPlugin
--------------------------------------------------------------------------------
/compilation/gradle.projectsetup/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.gradle.plugin-publish"
2 |
3 | pluginBundle {
4 | website = 'https://github.com/MONKEY-WORKS/BuildMonkey/wiki'
5 | vcsUrl = 'https://github.com/MONKEY-WORKS/BuildMonkey'
6 |
7 | plugins {
8 | projectSetupPlugin {
9 | description = 'Setups projects to be build from OSGi manifest files'
10 | tags = ['OSGi', 'build', 'MANIFEST']
11 | id = 'de.monkeyworks.buildmonkey.ProjectSetupPlugin'
12 | displayName = 'OSGi project setup plugin'
13 | }
14 | }
15 | plugins {
16 | fixDependencyPlugin {
17 | description = 'Fixes + version in pom files before publications'
18 | tags = ['publication', 'build', 'POM']
19 | id = 'de.monkeyworks.buildmonkey.FixDependencyVersion'
20 | displayName = 'Fix dependency version plugin'
21 | }
22 | }
23 |
24 | mavenCoordinates {
25 | groupId = "de.monkeyworks.buildmonkey"
26 | }
27 | }
--------------------------------------------------------------------------------
/compilation/gradle.projectsetup/src/main/groovy/de/monkeyworks/buildmonkey/projectsetup/FixDependencyVersion.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.projectsetup
9 |
10 | import org.gradle.api.Plugin
11 | import org.gradle.api.Project
12 | import org.gradle.api.publish.maven.MavenPom
13 | import org.gradle.api.publish.maven.internal.publication.DefaultMavenPublication
14 |
15 | class FixDependencyVersion implements Plugin {
16 |
17 | @Override
18 | public void apply(Project project) {
19 |
20 | if(!project.publishing.hasProperty('publications')) {
21 | return
22 | }
23 |
24 | project.publishing.publications.each {
25 | if(it instanceof DefaultMavenPublication) {
26 | DefaultMavenPublication publication = it as DefaultMavenPublication
27 | publication.pom.withXml {
28 | def node = asNode()
29 | def dependenciesNode = node.dependencies
30 |
31 | dependenciesNode.each { dependencyListNode ->
32 |
33 | def blackList = []
34 |
35 | dependencyListNode.each { dependencyNode ->
36 | def groupId = dependencyNode.groupId.text()
37 | def artifactId = dependencyNode.artifactId.text()
38 | def scope = dependencyNode.scope.text()
39 |
40 | if(dependencyNode.version.size() > 0) {
41 |
42 | def versionNode = dependencyNode.version.get(0)
43 | def version = versionNode.value()
44 |
45 | if(version.toString().contains('+')) {
46 | def matches = project
47 | .configurations."${scope}"
48 | .resolvedConfiguration.resolvedArtifacts.findAll{
49 | def dep = it.moduleVersion.id
50 | return dep.group == groupId && dep.name == artifactId
51 | }
52 | if(matches.size() > 0) {
53 | def newVersion = matches.first().moduleVersion.id.version
54 | versionNode.setValue(newVersion)
55 | }
56 | }
57 | }
58 | else {
59 | println "No version node found for ${groupId}:${artifactId}"
60 | blackList.add(dependencyNode)
61 | }
62 | }
63 | blackList.each {
64 | dependencyListNode.remove(it)
65 | }
66 | }
67 | }
68 | }
69 | }
70 | }
71 | }
--------------------------------------------------------------------------------
/compilation/gradle.projectsetup/src/main/groovy/de/monkeyworks/buildmonkey/projectsetup/ProjectSetupPlugin.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.projectsetup
9 |
10 | import org.gradle.api.Plugin
11 | import org.gradle.api.Project
12 |
13 | class ProjectSetupPlugin implements Plugin {
14 |
15 | private static final String xtextVersion = '+'
16 |
17 | @Override
18 | public void apply(Project project) {
19 | }
20 |
21 |
22 | private void applyXtendIfPresent(Project project) {
23 | /* if (project.file('src/main/xtend').exists() || project.file('src/test/xtend').exists()) {
24 | project.configure(project) {
25 | apply plugin: 'org.xtext.xtend'
26 | }
27 | project.sourceSets.create("src/main/xtend")
28 | project.sourceSets.create("src/test/xtend")
29 |
30 |
31 | Configuration config = project.configurations.getByName('compile')
32 | config.dependencies.create("org.eclipse.xtext:org.eclipse.xtext.builder:$xtextVersion")
33 | config.dependencies.create("org.eclipse.xtext:org.eclipse.xtext.generator:$xtextVersion")
34 |
35 | project.task("cleanXtend", type: Clean) {
36 | description = "Clean up generated files"
37 |
38 | delete fileTree(dir: xtendGenDir , include: '**//*.java')
39 | delete fileTree(dir: xtendTestDir , include: '**//*.java')
40 | }
41 | clean.dependsOn "cleanXtend"
42 | }
43 | */
44 | }
45 |
46 |
47 | }
--------------------------------------------------------------------------------
/compilation/gradle.projectsetup/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.FixDependencyVersion.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 the original author or authors.
3 | # All rights reserved. This program and the accompanying materials
4 | # are made available under the terms of the Eclipse Public License v1.0
5 | # which accompanies this distribution, and is available at
6 | # http://www.eclipse.org/legal/epl-v10.html
7 | #
8 |
9 | implementation-class=de.monkeyworks.buildmonkey.projectsetup.FixDependencyVersion
--------------------------------------------------------------------------------
/compilation/gradle.projectsetup/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.ProjectSetupPlugin.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 the original author or authors.
3 | # All rights reserved. This program and the accompanying materials
4 | # are made available under the terms of the Eclipse Public License v1.0
5 | # which accompanies this distribution, and is available at
6 | # http://www.eclipse.org/legal/epl-v10.html
7 | #
8 |
9 | implementation-class=de.monkeyworks.buildmonkey.projectsetup.ProjectSetupPlugin
--------------------------------------------------------------------------------
/docs/images/compilation_architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MONKEY-WORKS/BuildMonkey/a0deaf33613036af8d8561dc9f63540cb5887998/docs/images/compilation_architecture.png
--------------------------------------------------------------------------------
/examples/example1/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | buildMonkeySimpleExample
4 |
5 |
6 |
7 |
8 |
9 |
10 | org.eclipse.buildship.core.gradleprojectnature
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/example1/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.arguments=
2 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
3 | connection.java.home=null
4 | connection.jvm.arguments=
5 | connection.project.dir=
6 | derived.resources=.gradle,build
7 | eclipse.preferences.version=1
8 | project.path=\:
9 |
--------------------------------------------------------------------------------
/examples/example1/MonkeyPlugin/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/example1/MonkeyPlugin/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | MonkeyPlugin
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 | org.eclipse.buildship.core.gradleprojectnature
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/example1/MonkeyPlugin/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | build.commands=org.eclipse.jdt.core.javabuilder
2 | connection.arguments=
3 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
4 | connection.java.home=null
5 | connection.jvm.arguments=
6 | connection.project.dir=..
7 | derived.resources=.gradle,build
8 | eclipse.preferences.version=1
9 | natures=org.eclipse.jdt.core.javanature
10 | project.path=\:MonkeyPlugin
11 |
--------------------------------------------------------------------------------
/examples/example1/MonkeyPlugin/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4 | org.eclipse.jdt.core.compiler.compliance=1.8
5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7 | org.eclipse.jdt.core.compiler.source=1.8
8 |
--------------------------------------------------------------------------------
/examples/example1/MonkeyPlugin/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Bundle-ManifestVersion: 2
3 | Bundle-Name: MonkeyPlugin
4 | Bundle-SymbolicName: MonkeyPlugin;singleton:=true
5 | Bundle-Version: 1.0.0.qualifier
6 | Bundle-Vendor: MONKEY WORKS
7 | Require-Bundle: org.eclipse.ui
8 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8
9 | Bundle-ActivationPolicy: lazy
10 |
--------------------------------------------------------------------------------
/examples/example1/MonkeyPlugin/build.properties:
--------------------------------------------------------------------------------
1 | source.. = src/main/java
2 | output.. = bin/
3 | bin.includes = plugin.xml,\
4 | META-INF/,\
5 | .,\
6 | resources/icons/
7 |
--------------------------------------------------------------------------------
/examples/example1/MonkeyPlugin/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
10 |
11 |
15 |
16 |
17 |
19 |
22 |
23 |
24 |
26 |
31 |
32 |
33 |
35 |
37 |
48 |
49 |
51 |
53 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/examples/example1/MonkeyPlugin/resources/icons/monkey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MONKEY-WORKS/BuildMonkey/a0deaf33613036af8d8561dc9f63540cb5887998/examples/example1/MonkeyPlugin/resources/icons/monkey.png
--------------------------------------------------------------------------------
/examples/example1/MonkeyPlugin/src/main/java/de/monkeyworks/plugins/monkeyplugin/MonkeyHandler.java:
--------------------------------------------------------------------------------
1 | package de.monkeyworks.plugins.monkeyplugin;
2 |
3 | import org.eclipse.core.commands.AbstractHandler;
4 | import org.eclipse.core.commands.ExecutionEvent;
5 | import org.eclipse.core.commands.ExecutionException;
6 | import org.eclipse.ui.IWorkbenchWindow;
7 | import org.eclipse.ui.handlers.HandlerUtil;
8 | import org.eclipse.jface.dialogs.MessageDialog;
9 |
10 | /**
11 | * Our sample handler extends AbstractHandler, an IHandler base class.
12 | * @see org.eclipse.core.commands.IHandler
13 | * @see org.eclipse.core.commands.AbstractHandler
14 | */
15 | public class MonkeyHandler extends AbstractHandler {
16 |
17 | @Override
18 | public Object execute(ExecutionEvent event) throws ExecutionException {
19 | IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
20 | MessageDialog.openInformation(
21 | window.getShell(),
22 | "MonkeyPlugin",
23 | "Hello BuildMonkey!");
24 | return null;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/examples/example1/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ./gradlew clean --refresh-dependencies
3 | ./gradlew build
--------------------------------------------------------------------------------
/examples/example1/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MONKEY-WORKS/BuildMonkey/a0deaf33613036af8d8561dc9f63540cb5887998/examples/example1/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/examples/example1/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Jul 09 11:52:36 CEST 2016
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip
7 |
--------------------------------------------------------------------------------
/examples/example1/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn ( ) {
37 | echo "$*"
38 | }
39 |
40 | die ( ) {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/examples/example1/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/examples/example1/helloBuildMonkey.target:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/examples/example1/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = "buildMonkeySimpleExample"
2 |
3 | // Projects with default name and path behavior
4 | def projects = ['MonkeyPlugin']
5 |
6 | // Projects with uncommon path behavior
7 | // Use the following two lines as template
8 | // include ':'
9 | // project ':'.projectDir = new File(, )
10 |
11 | for(p in projects) {
12 | include ':' + p
13 | }
14 |
--------------------------------------------------------------------------------
/examples/exampleApp/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | buildMonkeyExampleE4App
4 |
5 |
6 |
7 |
8 |
9 |
10 | org.eclipse.buildship.core.gradleprojectnature
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/exampleApp/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.arguments=
2 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
3 | connection.java.home=null
4 | connection.jvm.arguments=
5 | connection.project.dir=
6 | derived.resources=.gradle,build
7 | eclipse.preferences.version=1
8 | project.path=\:
9 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | MonkeyExampleE4Application
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 | org.eclipse.buildship.core.gradleprojectnature
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
2 | connection.project.dir=
3 | eclipse.preferences.version=1
4 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4 | org.eclipse.jdt.core.compiler.compliance=1.8
5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7 | org.eclipse.jdt.core.compiler.source=1.8
8 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Bundle-ManifestVersion: 2
3 | Bundle-Name: ExampleE4Application
4 | Bundle-SymbolicName: MonkeyExampleE4Application;singleton:=true
5 | Bundle-Version: 1.0.0.qualifier
6 | Require-Bundle: javax.inject,
7 | org.eclipse.core.runtime,
8 | org.eclipse.swt,
9 | org.eclipse.e4.ui.model.workbench,
10 | org.eclipse.jface,
11 | org.eclipse.e4.ui.services,
12 | org.eclipse.e4.ui.workbench,
13 | org.eclipse.e4.core.di,
14 | org.eclipse.e4.ui.di,
15 | org.eclipse.e4.core.contexts
16 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8
17 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/build.gradle:
--------------------------------------------------------------------------------
1 | dependencies {
2 |
3 | }
4 |
5 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/build.properties:
--------------------------------------------------------------------------------
1 | source.. = src/main/java/
2 | output.. = bin/
3 | bin.includes = plugin.xml,\
4 | META-INF/,\
5 | .,\
6 | icons/,\
7 | css/default.css,\
8 | Application.e4xmi
9 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/css/default.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MONKEY-WORKS/BuildMonkey/a0deaf33613036af8d8561dc9f63540cb5887998/examples/exampleApp/MonkeyExampleE4Application/css/default.css
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/icons/sample.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MONKEY-WORKS/BuildMonkey/a0deaf33613036af8d8561dc9f63540cb5887998/examples/exampleApp/MonkeyExampleE4Application/icons/sample.png
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/icons/save_edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MONKEY-WORKS/BuildMonkey/a0deaf33613036af8d8561dc9f63540cb5887998/examples/exampleApp/MonkeyExampleE4Application/icons/save_edit.png
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
11 |
14 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/src/main/java/examplee4application/handlers/AboutHandler.java:
--------------------------------------------------------------------------------
1 | package examplee4application.handlers;
2 |
3 | import org.eclipse.e4.core.di.annotations.Execute;
4 | import org.eclipse.jface.dialogs.MessageDialog;
5 | import org.eclipse.swt.widgets.Shell;
6 |
7 | public class AboutHandler {
8 | @Execute
9 | public void execute(Shell shell) {
10 | MessageDialog.openInformation(shell, "About", "Eclipse 4 RCP Application");
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/src/main/java/examplee4application/handlers/OpenHandler.java:
--------------------------------------------------------------------------------
1 | package examplee4application.handlers;
2 |
3 | import org.eclipse.e4.core.di.annotations.Execute;
4 | import org.eclipse.swt.widgets.FileDialog;
5 | import org.eclipse.swt.widgets.Shell;
6 | public class OpenHandler {
7 |
8 | @Execute
9 | public void execute(Shell shell){
10 | FileDialog dialog = new FileDialog(shell);
11 | dialog.open();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/src/main/java/examplee4application/handlers/QuitHandler.java:
--------------------------------------------------------------------------------
1 | package examplee4application.handlers;
2 |
3 | import org.eclipse.e4.core.di.annotations.Execute;
4 | import org.eclipse.e4.ui.workbench.IWorkbench;
5 | import org.eclipse.jface.dialogs.MessageDialog;
6 | import org.eclipse.swt.widgets.Shell;
7 |
8 |
9 | public class QuitHandler {
10 | @Execute
11 | public void execute(IWorkbench workbench, Shell shell){
12 | if (MessageDialog.openConfirm(shell, "Confirmation",
13 | "Do you want to exit?")) {
14 | workbench.close();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/src/main/java/examplee4application/handlers/SaveHandler.java:
--------------------------------------------------------------------------------
1 | package examplee4application.handlers;
2 |
3 | import org.eclipse.e4.core.di.annotations.CanExecute;
4 | import org.eclipse.e4.core.di.annotations.Execute;
5 | import org.eclipse.e4.ui.workbench.modeling.EPartService;
6 |
7 | public class SaveHandler {
8 |
9 | @CanExecute
10 | public boolean canExecute(EPartService partService) {
11 | if (partService != null) {
12 | return !partService.getDirtyParts().isEmpty();
13 | }
14 | return false;
15 | }
16 |
17 | @Execute
18 | public void execute(EPartService partService) {
19 | partService.saveAll(false);
20 | }
21 | }
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyExampleE4Application/src/main/java/examplee4application/parts/SamplePart.java:
--------------------------------------------------------------------------------
1 | package examplee4application.parts;
2 |
3 | import java.util.Arrays;
4 | import java.util.List;
5 | import javax.annotation.PostConstruct;
6 | import javax.inject.Inject;
7 |
8 | import org.eclipse.e4.ui.di.Focus;
9 | import org.eclipse.e4.ui.di.Persist;
10 | import org.eclipse.e4.ui.model.application.ui.MDirtyable;
11 | import org.eclipse.jface.viewers.ArrayContentProvider;
12 | import org.eclipse.jface.viewers.TableViewer;
13 | import org.eclipse.swt.SWT;
14 | import org.eclipse.swt.events.ModifyEvent;
15 | import org.eclipse.swt.events.ModifyListener;
16 | import org.eclipse.swt.layout.GridData;
17 | import org.eclipse.swt.layout.GridLayout;
18 | import org.eclipse.swt.widgets.Composite;
19 | import org.eclipse.swt.widgets.Text;
20 |
21 | public class SamplePart {
22 |
23 | private Text txtInput;
24 | private TableViewer tableViewer;
25 |
26 | @Inject
27 | private MDirtyable dirty;
28 |
29 | @PostConstruct
30 | public void createComposite(Composite parent) {
31 | parent.setLayout(new GridLayout(1, false));
32 |
33 | txtInput = new Text(parent, SWT.BORDER);
34 | txtInput.setMessage("Enter text to mark part as dirty");
35 | txtInput.addModifyListener(new ModifyListener() {
36 | @Override
37 | public void modifyText(ModifyEvent e) {
38 | dirty.setDirty(true);
39 | }
40 | });
41 | txtInput.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
42 |
43 | tableViewer = new TableViewer(parent);
44 |
45 | tableViewer.setContentProvider(ArrayContentProvider.getInstance());;
46 | tableViewer.setInput(createInitialDataModel());
47 | tableViewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
48 | }
49 |
50 | @Focus
51 | public void setFocus() {
52 | tableViewer.getTable().setFocus();
53 | }
54 |
55 | @Persist
56 | public void save() {
57 | dirty.setDirty(false);
58 | }
59 |
60 | private List createInitialDataModel() {
61 | return Arrays.asList("Sample item 1", "Sample item 2", "Sample item 3", "Sample item 4", "Sample item 5");
62 | }
63 | }
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyHandlerPlugin/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyHandlerPlugin/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | MonkeyHandlerPlugin
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 | org.eclipse.buildship.core.gradleprojectnature
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyHandlerPlugin/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | build.commands=org.eclipse.jdt.core.javabuilder
2 | connection.arguments=
3 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
4 | connection.java.home=null
5 | connection.jvm.arguments=
6 | connection.project.dir=..
7 | derived.resources=.gradle,build
8 | eclipse.preferences.version=1
9 | natures=org.eclipse.jdt.core.javanature
10 | project.path=\:MonkeyPlugin
11 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyHandlerPlugin/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4 | org.eclipse.jdt.core.compiler.compliance=1.8
5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7 | org.eclipse.jdt.core.compiler.source=1.8
8 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyHandlerPlugin/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Bundle-ManifestVersion: 2
3 | Bundle-Name: MonkeyPlugin
4 | Bundle-SymbolicName: MonkeyHandlerPlugin;singleton:=true
5 | Bundle-Version: 1.0.0.qualifier
6 | Bundle-Vendor: Monkey-Works
7 | Require-Bundle: javax.inject,
8 | org.eclipse.ui,
9 | org.eclipse.e4.ui.model.workbench,
10 | org.eclipse.e4.core.di.annotations,
11 | org.eclipse.e4.core.di
12 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8
13 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyHandlerPlugin/build.gradle:
--------------------------------------------------------------------------------
1 | dependencies {
2 |
3 | }
4 |
5 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyHandlerPlugin/build.properties:
--------------------------------------------------------------------------------
1 | output.. = bin/
2 | bin.includes = plugin.xml,\
3 | META-INF/,\
4 | .,\
5 | resources/icons/,\
6 | fragment.e4xmi,\
7 | fragment.e4xmi
8 | source.. = src/main/java
9 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyHandlerPlugin/fragment.e4xmi:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyHandlerPlugin/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyHandlerPlugin/resources/icons/monkey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MONKEY-WORKS/BuildMonkey/a0deaf33613036af8d8561dc9f63540cb5887998/examples/exampleApp/MonkeyHandlerPlugin/resources/icons/monkey.png
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyHandlerPlugin/src/main/java/de/monkeyworks/plugins/monkeyhandlerplugin/MonkeyHandler.java:
--------------------------------------------------------------------------------
1 | package de.monkeyworks.plugins.monkeyhandlerplugin;
2 |
3 | import org.eclipse.core.commands.ExecutionException;
4 | import org.eclipse.e4.core.di.annotations.Execute;
5 | import org.eclipse.jface.dialogs.MessageDialog;
6 | import org.eclipse.swt.widgets.Display;
7 |
8 | /**
9 | * Our sample handler extends AbstractHandler, an IHandler base class.
10 | *
11 | * @see org.eclipse.core.commands.IHandler
12 | * @see org.eclipse.core.commands.AbstractHandler
13 | */
14 | public class MonkeyHandler {
15 |
16 | @Execute
17 | public Object execute() throws ExecutionException {
18 | MessageDialog.openInformation(Display.getCurrent().getActiveShell(), Text.TITLE, Text.MESSAGE);
19 | return null;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/exampleApp/MonkeyHandlerPlugin/src/main/java/de/monkeyworks/plugins/monkeyhandlerplugin/Text.java:
--------------------------------------------------------------------------------
1 | package de.monkeyworks.plugins.monkeyhandlerplugin;
2 |
3 | public interface Text {
4 | String TITLE = "MonkeyHandlerPlugin";
5 | String MESSAGE = "Hello Monkey!";
6 | }
7 |
--------------------------------------------------------------------------------
/examples/exampleApp/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | rm -rf $(pwd)/build/merge-repository
3 | ${ECLIPSE_HOME}/eclipse \
4 | -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication \
5 | -source file:$(pwd)/build/monkey-repository \
6 | -destination file:$(pwd)/build/merge-repository \
7 | -nosplash \
8 | -Dequinox.scr.waitTimeOnBlock=900000
9 |
10 | ${ECLIPSE_HOME}/eclipse \
11 | -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication \
12 | -source file:$(pwd)/build/p2-repository \
13 | -destination file:$(pwd)/build/merge-repository \
14 | -nosplash \
15 | -Dequinox.scr.waitTimeOnBlock=900000
16 |
17 | ${ECLIPSE_HOME}/eclipse \
18 | -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication \
19 | -source file:$(pwd)/build/monkey-repository \
20 | -destination file:$(pwd)/build/merge-repository \
21 | -nosplash \
22 | -Dequinox.scr.waitTimeOnBlock=900000
23 |
24 | ${ECLIPSE_HOME}/eclipse \
25 | -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication \
26 | -source file:$(pwd)/build/p2-repository \
27 | -destination file:$(pwd)/build/merge-repository \
28 | -nosplash \
29 | -Dequinox.scr.waitTimeOnBlock=900000
30 |
31 | ${ECLIPSE_HOME}/eclipse -application org.eclipse.equinox.p2.publisher.ProductPublisher \
32 | -metadataRepository file:/home/micha/branches/github/BuildMonkey/examples/exampleApp/build/merge-repository \
33 | -artifactRepository file:/home/micha/branches/github/BuildMonkey/examples/exampleApp/build/merge-repository \
34 | -productFile /home/micha/branches/github/BuildMonkey/examples/exampleApp/MonkeyExampleE4Application/MonkeyExcampleE4Application.product \
35 | -executables file:/home/micha/branches/github/BuildMonkey/examples/exampleApp/build/p2-repository/features/org.eclipse.equinox.executable_3.6.300.v20161122-1740/ \
36 | -publishArtifacts \
37 | -append \
38 | -flavor tooling \
39 | -configs gtk.linux.x86_64,win32.win32.x86_64 \
40 | -nosplash \
41 | -Dequinox.scr.waitTimeOnBlock=900000
42 |
43 | ${ECLIPSE_HOME}/eclipse \
44 | -application org.eclipse.equinox.p2.director \
45 | -repository file:/home/micha/branches/github/BuildMonkey/examples/exampleApp/build/merge-repository \
46 | -installIU MonkeyExampleE4Application.product \
47 | -tag InitialState \
48 | -destination /home/micha/branches/github/BuildMonkey/examples/exampleApp/product/linux \
49 | -profile DefaultProfile \
50 | -profileProperties org.eclipse.update.install.features=true \
51 | -p2.os linux \
52 | -p2.ws gtk \
53 | -p2.arch x86_64 \
54 | -roaming \
55 | -nosplash
56 |
57 | ${ECLIPSE_HOME}/eclipse \
58 | -application org.eclipse.equinox.p2.director \
59 | -repository file:/home/micha/branches/github/BuildMonkey/examples/exampleApp/build/merge-repository \
60 | -installIU MonkeyExampleE4Application.product \
61 | -tag InitialState \
62 | -destination /home/micha/branches/github/BuildMonkey/examples/exampleApp/product/win \
63 | -profile DefaultProfile \
64 | -profileProperties org.eclipse.update.install.features=true \
65 | -p2.os win32 \
66 | -p2.ws win32 \
67 | -p2.arch x86_64 \
68 | -roaming \
69 | -nosplash
70 |
--------------------------------------------------------------------------------
/examples/exampleApp/exampleE4App.target:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/exampleApp/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MONKEY-WORKS/BuildMonkey/a0deaf33613036af8d8561dc9f63540cb5887998/examples/exampleApp/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/examples/exampleApp/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Jul 19 11:17:56 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip
7 |
--------------------------------------------------------------------------------
/examples/exampleApp/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn ( ) {
37 | echo "$*"
38 | }
39 |
40 | die ( ) {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/examples/exampleApp/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/examples/exampleApp/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = "buildMonkeyExampleE4App"
2 |
3 | // Projects with default name and path behavior
4 | def projects = ['MonkeyHandlerPlugin', 'MonkeyExampleE4Application']
5 |
6 | // Projects with uncommon path behavior
7 | // Use the following two lines as template
8 | // include ':'
9 | // project ':'.projectDir = new File(, )
10 |
11 | for(p in projects) {
12 | include ':' + p
13 | }
14 |
--------------------------------------------------------------------------------
/examples/exampleM2/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | // Uncomment for local deployment of built plugins
4 | //mavenLocal()
5 |
6 | // The BuildMonkey plugins are published here
7 | maven { url "https://plugins.gradle.org/m2/"}
8 |
9 | // Default repositories for all the maven dependencies of this world
10 | mavenCentral()
11 | jcenter()
12 | maven {
13 | url "http://dl.bintray.com/monkey-works/BuildMonkey"
14 | }
15 | }
16 |
17 | // Get BuildMonkey plugins
18 | dependencies {
19 | classpath "de.monkeyworks.buildmonkey:gradle.mavenize:0.4"
20 | classpath "de.monkeyworks.buildmonkey:mavenArtefacts:0.4.1"
21 | classpath 'de.monkeyworks.buildmonkey:artifactoryupload:0.4.1'
22 | classpath 'org.standardout:bnd-platform:1.4.0'
23 | }
24 | }
25 |
26 |
27 | apply plugin: 'de.monkeyworks.buildmonkey.maven.MavenArtefactsPlugin'
28 |
29 | convertMaven {
30 | artefacts = ['org.objenesis:objenesis:2.2', 'org.mockito:mockito-core:1.10.19', 'org.hamcrest:hamcrest-core:1.3']
31 | prefix = 'buildMonkey'
32 | updateSiteDir = "${project.buildDir}/site"
33 | targetDir = "${project.buildDir}/maven-repository"
34 |
35 | featureId = 'BuildMonkeyTestDependencies'
36 | featureName = 'BuildMonkeyTestDependencies'
37 | featureVersion = '1.0.0'
38 |
39 | repositoryServerURL = 'put in url of your artifactory server: https://myArtifactoryServer.mydomain/artifactory/'
40 | repositoryUser = 'put in user name with write access'
41 | repositoryPassword = 'put in password of the user above'
42 |
43 | mavenRepositoryName = 'Thirdparty/buildmonkey/MavenM2'
44 | p2RepositoryName = 'Thirdparty/buildmonkey/MavenP2'
45 | }
46 |
47 |
48 |
--------------------------------------------------------------------------------
/examples/exampleM2/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ./gradlew clean --refresh-dependencies
3 | ./gradlew build
--------------------------------------------------------------------------------
/examples/exampleM2/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MONKEY-WORKS/BuildMonkey/a0deaf33613036af8d8561dc9f63540cb5887998/examples/exampleM2/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/examples/exampleM2/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Jul 09 11:52:36 CEST 2016
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip
7 |
--------------------------------------------------------------------------------
/examples/exampleM2/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn ( ) {
37 | echo "$*"
38 | }
39 |
40 | die ( ) {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/examples/exampleM2/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MONKEY-WORKS/BuildMonkey/a0deaf33613036af8d8561dc9f63540cb5887998/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Apr 28 09:59:55 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/build.gradle:
--------------------------------------------------------------------------------
1 | dependencies {
2 | compile 'org.eclipse.platform:org.eclipse.core.runtime:+'
3 | compile 'org.eclipse.platform:org.eclipse.equinox.common:+'
4 | compile('org.eclipse.jdt:org.eclipse.jdt.junit.core:+'){
5 | exclude group: 'org.eclipse.jdt', module: 'org.eclipse.jdt.debug'
6 | exclude group: 'org.eclipse.jdt', module: 'org.eclipse.jdt.core'
7 | }
8 | compile 'org.eclipse.platform:org.eclipse.osgi:3.12.0'
9 | compile 'org.eclipse.platform:org.eclipse.osgi.compatibility.state:+'
10 | compile 'org.apache.bcel:bcel:+'
11 |
12 | //DUPLICATED BundleMavenDeployer, must be into replaced by a common bundle
13 | compile 'org.apache.maven:maven-ant-tasks:2.1.3'
14 | compile 'de.monkeyworks.buildmonkey:base:1.0.4'
15 |
16 | }
17 |
18 | apply plugin: "com.gradle.plugin-publish"
19 | version = '0.4.19'
20 |
21 | pluginBundle {
22 | website = 'https://github.com/MONKEY-WORKS/BuildMonkey/wiki'
23 | vcsUrl = 'https://github.com/MONKEY-WORKS/BuildMonkey'
24 | description = 'Plugins for materialize eclipse rcp applications and execution plugins based tests'
25 | tags = ['OSGi', 'PDE', 'eclipse', 'swtbot']
26 |
27 | plugins {
28 | pluginTestPlugin {
29 | id = 'de.monkeyworks.buildmonkey.pde.PluginTestPlugin'
30 | displayName = 'Executing OSGi plugin tests'
31 | }
32 |
33 | testDefinitionPlugin {
34 | id = 'de.monkeyworks.buildmonkey.pde.TestDefinitionPlugin'
35 | displayName = 'Defining OSGi plugin tests'
36 | }
37 | uiTestPlugin {
38 | id = 'de.monkeyworks.buildmonkey.pde.UiTestPlugin'
39 | displayName = 'Executing swtbot tests'
40 | }
41 |
42 | uiTestDefinitionPlugin {
43 | id = 'de.monkeyworks.buildmonkey.pde.UITestDefinitionPlugin'
44 | displayName = 'Defining SWTBOT tests'
45 | }
46 | }
47 | mavenCoordinates {
48 | groupId = "de.monkeyworks.buildmonkey"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/Config.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Donát Csikós (Gradle Inc.) - initial API and implementation and initial documentation
10 | */
11 |
12 | package de.monkeyworks.buildmonkey.pde
13 |
14 | import org.gradle.api.Project
15 | import org.gradle.internal.os.OperatingSystem
16 |
17 |
18 | /**
19 | * Holds configuration-dependent settings for the plug-ins.
20 | */
21 | class Config {
22 |
23 | private final Project project
24 |
25 | static Config on(Project project) {
26 | return new Config(project)
27 | }
28 |
29 | private Config(Project project) {
30 | this.project = project
31 | }
32 |
33 |
34 | File getTargetPlatformsDir() {
35 | // to avoid configuration timing issues we don't cache the values in fields
36 | project.hasProperty('targetPlatformsDir') ?
37 | new File(project.property('targetPlatformsDir') as String) :
38 | new File(project.buildDir, 'targetPlatforms')
39 | }
40 |
41 | File getTargetPlatformDir() {
42 | new File(targetPlatformsDir, "pluginTests")
43 | }
44 |
45 | File getNonMavenizedTargetPlatformDir() {
46 | new File(targetPlatformDir, 'target-platform')
47 | }
48 |
49 | File getRootNonMavenizedTargetPlatformDir() {
50 | new File(project.parent.buildDir, 'targetPlatforms/pluginTests/target-platform')
51 | }
52 |
53 | File getP2TargetPlatformDir() {
54 | new File(targetPlatformDir, 'updatesite')
55 | }
56 |
57 | File getMavenizedTargetPlatformDir() {
58 | new File(targetPlatformDir, 'mavenized-target-platform')
59 | }
60 |
61 | File getWorkspace() {
62 | new File ("${project.buildDir}/pluginTest/workspace")
63 | }
64 |
65 | /**
66 | * Returns the Eclipse runtime abbreviation of the operating system.
67 | *
68 | * http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html
69 | *
70 | * @return the operating system: 'linux', 'win32', 'macosx', or null
71 | */
72 | static String getOs() {
73 | OperatingSystem os = OperatingSystem.current()
74 | os.isLinux() ? 'linux' : os.isWindows() ? 'win32' : os.isMacOsX() ? 'macosx': null
75 | }
76 |
77 | /**
78 | * Return the Eclipse runtime abbreviation of the windowing system.
79 | *
80 | * http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html
81 | *
82 | * @return the windowing system: 'gtk', 'win32', 'cocoa', or null
83 | */
84 | static String getWs() {
85 | OperatingSystem os = OperatingSystem.current()
86 | os.isLinux() ? 'gtk' : os.isWindows() ? 'win32' : os.isMacOsX() ? 'cocoa' : null
87 | }
88 |
89 | /**
90 | * Returns the Eclipse runtime abbreviation of the architecture.
91 | *
92 | * http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html
93 | *
94 | * @return the architecture: x86_64 or x86
95 | */
96 | static String getArch() {
97 | System.getProperty("os.arch").contains("64") ? "x86_64" : "x86"
98 | }
99 |
100 | /**
101 | * Sets some constants in the target project's build script.
102 | */
103 | static exposePublicConstantsFor(Project project) {
104 | project.ext.ECLIPSE_OS = os
105 | project.ext.ECLIPSE_WS = ws
106 | project.ext.ECLIPSE_ARCH = arch
107 | }
108 |
109 | /**
110 | * Returns the group name of all tasks that contribute to the Eclipse Plugin build.
111 | *
112 | * @return the name of the group where all tasks defined in this project should show upon the execution of gradle tasks
113 | */
114 | static String getGradleTaskGroupName() {
115 | return "PDE Test Plugin Build"
116 | }
117 |
118 | }
119 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/PluginUtils.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Donát Csikós (Gradle Inc.) - initial API and implementation and initial documentation
10 | */
11 |
12 | package de.monkeyworks.buildmonkey.pde
13 |
14 | import org.apache.tools.ant.filters.ReplaceTokens
15 | import org.gradle.api.Project
16 |
17 | /**
18 | * Static helper functions which can be used different places around the Eclipse plugin build.
19 | */
20 | public class PluginUtils {
21 |
22 | /**
23 | * Copies the content of the plugin project's MANIFEST.MF file to the plugin artifact generated by the jar task of this project.
24 | * While copying the MANIFEST.MF file, the value of the Bundle-Version attribute is replaced with the build version of the project.
25 | *
26 | * @param project the plugin project whose MANIFEST.MF file of the artifact of the jar task to update
27 | */
28 | static void updatePluginManifest(Project project) {
29 | project.jar {
30 | manifest {
31 | attributes 'Bundle-Version' : project.version
32 | from('META-INF/MANIFEST.MF') {
33 | eachEntry { entry ->
34 | if (entry.key == 'Bundle-Version') {
35 | entry.value = project.version
36 | }
37 | }
38 | }
39 | }
40 | }
41 | }
42 |
43 | /**
44 | * Configures the plugin artifact generated by the jar task of this plugin project to have the same content as declared in the
45 | * plugin project's build.properties file.
46 | *
47 | * @param project the plugin project whose content of the artifact of the jar task to configure
48 | */
49 | static void configurePluginJarInput(Project project) {
50 | def buildProperties = readBuildPropertiesFile(project)
51 | Set resources = splitBinIncludes(buildProperties.getProperty('bin.includes'))
52 | addPluginJarInput(resources, project)
53 | }
54 |
55 | /**
56 | * Configures the feature artifact generated by the jar task of this feature project to have the same content as declared in the
57 | * plugin project's build.properties file. While configuring the jar task, the version placeholder in the feature.xml file
58 | * is replaced with the build version of the project.
59 | *
60 | * @param project the plugin project whose content of the artifact of the jar task to configure
61 | */
62 | static void configureFeatureJarInput(Project project) {
63 | def buildProperties = readBuildPropertiesFile(project)
64 | Set resources = splitBinIncludes(buildProperties.getProperty('bin.includes'))
65 | addFeatureJarInput(resources, project)
66 | }
67 |
68 | static String findLauncherVersion(def targetDir) {
69 |
70 | def equinoxLaunchers = new FileNameFinder().getFileNames(targetDir.toAbsolutePath().toFile().toString(), 'org.eclipse.equinox.launcher_*.jar')
71 | assert equinoxLaunchers.size() > 0
72 |
73 | String tmp = equinoxLaunchers.get(0)
74 | tmp = tmp.substring(tmp.indexOf("org.eclipse.equinox.launcher_") + ("org.eclipse.equinox.launcher_").length())
75 | tmp = tmp.substring(0, tmp.indexOf(".jar"))
76 |
77 | return tmp
78 | }
79 |
80 | private static Properties readBuildPropertiesFile(Project project) {
81 | def buildProperties = new Properties()
82 | def fis = new FileInputStream(project.file('build.properties'))
83 | buildProperties.load(fis)
84 | fis.close()
85 | buildProperties
86 | }
87 |
88 | private static Set splitBinIncludes(String binIncludes) {
89 | Set result = new LinkedHashSet()
90 | def virtualResources = ['.']
91 | binIncludes.split(',').each { relPath ->
92 | relPath = relPath.trim()
93 | if(!relPath.isEmpty() && !(relPath in virtualResources)) {
94 | result.add(relPath)
95 | }
96 | }
97 | result
98 | }
99 |
100 | private static void addPluginJarInput(Set locations, Project project) {
101 | for (String location in locations) {
102 | File resource = project.file(location)
103 | if (resource.isDirectory()) {
104 | project.jar {
105 | from(location, { into(location) })
106 | }
107 | } else {
108 | project.jar {
109 | from location
110 | }
111 | }
112 | }
113 | }
114 |
115 | private static void addFeatureJarInput(Set locations, Project project) {
116 | for (String location in locations) {
117 | File resource = project.file(location)
118 | if (resource.isDirectory()) {
119 | project.jar {
120 | from(location, { into(location) })
121 | }
122 | } else {
123 | project.jar {
124 | from location
125 | if (resource.name == 'feature.xml') {
126 | filter(ReplaceTokens, tokens:['1.0.0.qualifier' : '"' + project.version + '"'], beginToken: '"', endToken: '"')
127 | filter(ReplaceTokens, tokens:['0.0.0' : '"' + project.version + '"'], beginToken: '"', endToken: '"')
128 | }
129 | }
130 | }
131 | }
132 | }
133 |
134 | }
135 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/mavenize/Bundle2Pom.groovy:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 Andrey Hihlovskiy
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | */
14 | //DUPLICATED, must be part of a common bundle
15 | package de.monkeyworks.buildmonkey.pde.mavenize
16 |
17 | import java.util.jar.JarFile
18 | import java.util.jar.Manifest
19 | import org.osgi.framework.Constants
20 |
21 | /**
22 | * Converts bundle manifest to POM.
23 | */
24 | final class Bundle2Pom {
25 | String group
26 | String dependencyGroup
27 |
28 | /**
29 | * Constructs Bundle2Pom object with the specified parameters.
30 | * @param group - maven group to which the given artifact belongs.
31 | * @param dependencyGroup - maven group to which the dependencies of the given artifact belong.
32 | */
33 | Bundle2Pom(String group = null, String dependencyGroup = null) {
34 | this.group = group
35 | this.dependencyGroup = dependencyGroup
36 | }
37 |
38 | /**
39 | * Converts bundle to POM.
40 | * @param bundleFileOrDirectory - jar-file or directory containing OSGi bundle.
41 | * @return the converted POM.
42 | */
43 | Pom convert(File bundleFileOrDirectory) {
44 | def pom = new Pom()
45 | def manifest
46 | if (bundleFileOrDirectory.isDirectory()) {
47 | new File(bundleFileOrDirectory, 'META-INF/MANIFEST.MF').withInputStream {
48 | manifest = new Manifest(it)
49 | }
50 | pom.packaging = 'dir'
51 | } else
52 | manifest = new JarFile(bundleFileOrDirectory).manifest
53 |
54 | pom.artifact = manifest.attr.getValue(Constants.BUNDLE_SYMBOLICNAME)
55 | if (pom.artifact.contains(';'))
56 | pom.artifact = pom.artifact.split(';')[0]
57 | pom.artifact = pom.artifact.trim()
58 |
59 | pom.group = group ?: pom.artifact
60 | pom.dependencyGroup = dependencyGroup
61 |
62 | // cut the qualifier and use only the major.minor.service segments as version number
63 | // this is in sync with version constraints declared in the bundle manifest
64 | def version = new Version(manifest.attr.getValue(Constants.BUNDLE_VERSION))
65 | pom.version = "${version.major}.${version.minor}.${version.release}"
66 |
67 | parseDependencyBundles(pom.dependencyBundles, manifest.attr.getValue(Constants.REQUIRE_BUNDLE))
68 |
69 | return pom
70 | }
71 |
72 | private DependencyBundle parseDependencyBundle(String string) {
73 | List elements = string.split(';')
74 | String name = elements[0]
75 | elements.remove(0)
76 | DependencyBundle bundle = new DependencyBundle(name: name, resolution: Constants.RESOLUTION_MANDATORY, visibility: Constants.VISIBILITY_PRIVATE, version: "[1.0,)")
77 | for(String element in elements)
78 | if (element.startsWith(Constants.BUNDLE_VERSION_ATTRIBUTE)) {
79 | String s = element.substring(element.indexOf('=') + 1)
80 | if(s.startsWith('"'))
81 | s = s.substring(1)
82 | if(s.endsWith('"'))
83 | s = s.substring(0, s.length() - 1)
84 | bundle.version = s
85 | } else if (element.startsWith(Constants.RESOLUTION_DIRECTIVE))
86 | bundle.resolution = element.substring(element.indexOf('=') + 1)
87 | else if (element.startsWith(Constants.VISIBILITY_DIRECTIVE))
88 | bundle.visibility = element.substring(element.indexOf('=') + 1)
89 | return bundle
90 | }
91 |
92 | private void parseDependencyBundles(List depBundles, String depBundlesString) {
93 | if(!depBundlesString)
94 | return
95 | int startPos = 0
96 | boolean quoted = false
97 | for(int i = 0; i < depBundlesString.length(); i++) {
98 | char c = depBundlesString.charAt(i)
99 | if(c == ',' && !quoted) {
100 | depBundles.add(parseDependencyBundle(depBundlesString.substring(startPos, i)))
101 | startPos = i + 1
102 | } else if(c == '"')
103 | quoted = !quoted
104 | }
105 | if(startPos < depBundlesString.length())
106 | depBundles.add(parseDependencyBundle(depBundlesString.substring(startPos, depBundlesString.length())))
107 | }
108 | }
109 |
110 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/mavenize/DependencyBundle.groovy:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 Andrey Hihlovskiy
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | */
14 | //DUPLICATED, must be part of a common bundle
15 | package de.monkeyworks.buildmonkey.pde.mavenize
16 |
17 | import groovy.transform.ToString
18 |
19 | /**
20 | * POJO class holding data on dependency bundle. Used by {@link org.akhikhl.unpuzzle.osgi2maven.Pom} class.
21 | */
22 | @ToString
23 | public final class DependencyBundle {
24 | String group
25 | String name
26 | String version
27 | String visibility
28 | String resolution
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/mavenize/DeployMavenAntTaskExecutor.groovy:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 Andrey Hihlovskiy
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | */
14 | //DUPLICATED, must be part of a common bundle
15 | package de.monkeyworks.buildmonkey.pde.mavenize
16 |
17 | import org.apache.maven.artifact.ant.Mvn;
18 |
19 | /**
20 | * Deploys OSGI bundle (jar or directory) to maven repository
21 | */
22 | class DeployMavenAntTaskExecutor {
23 | final AntBuilder ant
24 | final File target
25 | final File workFolder
26 |
27 | /**
28 | * Constructs Deployer with the specified parameters.
29 | */
30 | DeployMavenAntTaskExecutor(AntBuilder ant, File target) {
31 | this.ant = ant
32 | this.ant.taskdef(resource: 'org/apache/maven/artifact/ant/antlib.xml', classpath: Mvn.class.getProtectionDomain().getCodeSource().getLocation())
33 | this.target = target
34 | this.workFolder = new File(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString())
35 | }
36 |
37 | /**
38 | * Deploys the specified bundle with the specified POM to target maven repository.
39 | * @param options - may contain sourceFile (of type java.io.File), pointing to sources jar.
40 | * @param pomStruct - contains POM that will be used for deployment
41 | * @param bundleFileOrDirectory - jar-file or directory, containing OSGI bundle
42 | */
43 | void deployBundle(Map options = [:], Pom pomStruct, File bundleFileOrDirectory) {
44 | workFolder.mkdirs()
45 | String temporaryM2FolderPath = new File(workFolder, ".m2").absolutePath
46 | def pomFile = new File(workFolder, 'myPom.xml')
47 | File bundleFile
48 | if (bundleFileOrDirectory.isDirectory()) {
49 | pomStruct.packaging = 'jar'
50 | pomFile.text = pomStruct.toString()
51 | File zipFile = new File(workFolder, "${pomStruct.artifact}-${pomStruct.version}.jar")
52 | ant.zip(basedir: bundleFileOrDirectory, destfile: zipFile)
53 | bundleFile = zipFile
54 | }
55 | else {
56 | pomFile.text = pomStruct.toString()
57 | bundleFile = bundleFileOrDirectory
58 | }
59 | File sourceFile = options.sourceFile
60 | if(sourceFile?.isDirectory()) {
61 | File zipFile = new File(workFolder, sourceFile.name + '.jar')
62 | ant.zip(basedir: sourceFile, destfile: zipFile)
63 | sourceFile = zipFile
64 | }
65 | ant.with {
66 | pom id: 'mypom', file: pomFile
67 | deploy file: bundleFile, {
68 | pom refid: 'mypom'
69 | if(sourceFile)
70 | attach file: sourceFile, type: 'jar', classifier: 'sources'
71 |
72 | localRepository id:"local.repository", path: temporaryM2FolderPath, layout:"default"
73 | remoteRepository url: this.target.toURI().toURL().toString(), {}
74 | }
75 | }
76 | }
77 |
78 | void cleanup() {
79 | // delete the working directory
80 | if(workFolder.exists()){
81 | workFolder.deleteDir()
82 | }
83 | // clean up md5 sum files generated by the ant maven deploy task
84 | new File(System.getProperty('java.io.tmpdir')).eachFileMatch(~/maven-artifact\d+\.tmp/) { it.delete() }
85 | }
86 | }
87 |
88 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/mavenize/Pom.groovy:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 Andrey Hihlovskiy
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | */
14 | //DUPLICATED, must be part of a common bundle
15 | package de.monkeyworks.buildmonkey.pde.mavenize
16 |
17 | import groovy.xml.MarkupBuilder
18 | import org.osgi.framework.Constants
19 |
20 | /**
21 | * POJO class holding data extracted from bundle and needed for POM generation.
22 | */
23 | public final class Pom {
24 | private static final String encoding = 'UTF-8'
25 |
26 | String group
27 | String artifact
28 | String version
29 | String packaging = 'jar'
30 | List dependencyBundles = []
31 | String dependencyGroup
32 |
33 | String toString() {
34 | ByteArrayOutputStream stm = new ByteArrayOutputStream()
35 | writeTo(new OutputStreamWriter(stm, encoding))
36 | String result = stm.toString(encoding)
37 | if(result.charAt(0) == 0xfeff)
38 | result = result.substring(1) // remove BOM, if present
39 | return result
40 | }
41 |
42 | void writeTo(Writer writer) {
43 | def builder = new MarkupBuilder(writer)
44 | builder.mkp.xmlDeclaration(version: '1.0', encoding: encoding)
45 | def pom = this
46 | builder.project xmlns: 'http://maven.apache.org/POM/4.0.0', 'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance', {
47 | modelVersion '4.0.0'
48 | if(pom.group)
49 | groupId pom.group
50 | if(pom.artifact)
51 | artifactId pom.artifact
52 | if(pom.version)
53 | version pom.version
54 | if(pom.packaging != 'jar')
55 | packaging pom.packaging
56 | if(pom.dependencyBundles)
57 | dependencies {
58 | for(def depBundle in pom.dependencyBundles)
59 | dependency {
60 | if(depBundle.group)
61 | groupId depBundle.group
62 | else if(dependencyGroup)
63 | groupId dependencyGroup
64 | else
65 | groupId depBundle.name
66 | artifactId depBundle.name
67 | if(depBundle.version)
68 | version depBundle.version
69 | scope 'compile'
70 | if(depBundle.resolution == Constants.RESOLUTION_OPTIONAL)
71 | optional true
72 | }
73 | }
74 | }
75 | }
76 | }
77 |
78 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/mavenize/Version.groovy:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 Andrey Hihlovskiy
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | */
14 | //DUPLICATED, must be part of a common bundle
15 | package de.monkeyworks.buildmonkey.pde.mavenize
16 |
17 | /**
18 | * OSGi-specific version.
19 | */
20 | final class Version {
21 | long major = 0, minor = 0, release = 0
22 | String suffix = ''
23 |
24 | Version(de.monkeyworks.buildmonkey.pde.mavenize.Pom pom) {
25 | init(pom.version)
26 | }
27 |
28 | Version(String versionStr) {
29 | init(versionStr)
30 | }
31 |
32 | int compare(Version other) {
33 | int result = major - other.major
34 | if(result != 0)
35 | return result
36 | result = minor - other.minor
37 | if(result != 0)
38 | return result
39 | result = release - other.release
40 | if(result != 0)
41 | return result
42 | return suffix.compareTo(other.suffix)
43 | }
44 |
45 | private void init(String versionStr) {
46 | def m = versionStr =~ /(\d+)(\.(\d+))?(\.(\d+))?(\.(.+))?/
47 | if(m) {
48 | major = Long.valueOf(m[0][1] ?: '0')
49 | minor = Long.valueOf(m[0][3] ?: '0')
50 | release = Long.valueOf(m[0][5] ?: '0')
51 | suffix = m[0][7] ?: ''
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/testing/PluginTestClassScanner.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Donát Csikós (Gradle Inc.) - initial API and implementation and initial documentation
10 | */
11 |
12 | package de.monkeyworks.buildmonkey.pde.testing;
13 |
14 | import java.io.File;
15 |
16 | import groovy.lang.Closure;
17 | import org.apache.bcel.classfile.ClassParser;
18 | import org.apache.bcel.classfile.JavaClass;
19 | import org.gradle.api.file.EmptyFileVisitor;
20 | import org.gradle.api.file.FileTree;
21 | import org.gradle.api.file.FileVisitDetails;
22 | import org.gradle.api.internal.tasks.testing.DefaultTestClassRunInfo;
23 | import org.gradle.api.internal.tasks.testing.TestClassProcessor;
24 | import org.gradle.api.internal.tasks.testing.TestClassRunInfo;
25 |
26 | public final class PluginTestClassScanner implements Runnable {
27 |
28 | private final FileTree candidateClassFiles;
29 | private final TestClassProcessor testClassProcessor;
30 | private final Closure testClassClosure;
31 |
32 | public PluginTestClassScanner(FileTree candidateClassFiles, TestClassProcessor testClassProcessor, Closure testClassClosure) {
33 | this.candidateClassFiles = candidateClassFiles;
34 | this.testClassProcessor = testClassProcessor;
35 | this.testClassClosure = testClassClosure;
36 | }
37 |
38 | @Override
39 | public void run() {
40 | this.candidateClassFiles.visit(new ClassFileVisitor() {
41 |
42 | @Override
43 | public void visitClassFile(FileVisitDetails fileDetails) {
44 | String className = fileDetails.getRelativePath().getPathString().replaceAll("\\.class", "").replace('/', '.');
45 | TestClassRunInfo testClass = new DefaultTestClassRunInfo(className);
46 | System.out.println(testClass.getTestClassName());
47 | PluginTestClassScanner.this.testClassProcessor.processTestClass(testClass);
48 | }
49 | });
50 | }
51 |
52 | private abstract class ClassFileVisitor extends EmptyFileVisitor {
53 |
54 | @Override
55 | public void visitFile(FileVisitDetails fileDetails) {
56 | final File file = fileDetails.getFile();
57 | if (isValidTestClassFile(file)) {
58 | visitClassFile(fileDetails);
59 | }
60 | }
61 |
62 | private boolean isValidTestClassFile(final File file) {
63 | try {
64 | boolean closureMatching = (testClassClosure != null && (Boolean)testClassClosure.call(file));
65 | System.out.println("Check class file: " + file.getName() + ":" + closureMatching + ":" + isTopLevelClass(file) + ":" + isConcreteClass(file));
66 | return (closureMatching || isTopLevelClass(file)) && isConcreteClass(file);
67 | } catch (Exception e) {
68 | System.out.println("Exception for class " + file.getName() + ": " + e.getLocalizedMessage());
69 | e.printStackTrace();
70 | return false;
71 | }
72 | }
73 |
74 | private boolean isTopLevelClass(final File file) {
75 | return file.getAbsolutePath().endsWith("Test.class") && !file.getAbsolutePath().contains("$");
76 | }
77 |
78 | private boolean isConcreteClass(File file) throws Exception {
79 | ClassParser parser = new ClassParser(file.getAbsolutePath());
80 | JavaClass javaClass = parser.parse();
81 | return !javaClass.isAbstract() && !javaClass.isInterface();
82 | }
83 |
84 | public abstract void visitClassFile(FileVisitDetails fileDetails);
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/testing/PluginTestExtension.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Donát Csikós (Gradle Inc.) - initial API and implementation and initial documentation
10 | */
11 |
12 | package de.monkeyworks.buildmonkey.pde.testing;
13 |
14 | import groovy.lang.Closure;
15 | import org.gradle.api.internal.file.FileResolver;
16 | import org.gradle.internal.impldep.com.amazonaws.services.kms.model.UnsupportedOperationException;
17 |
18 | import javax.inject.Inject;
19 | import java.io.File;
20 | import java.util.List;
21 |
22 | public class PluginTestExtension {
23 |
24 | private String fragmentHost;
25 |
26 | /**
27 | * Application launched in Eclipse.
28 | * {@code org.eclipse.pde.junit.runtime.coretestapplication} can be used to run non-UI tests.
29 | */
30 | private String applicationName = "org.eclipse.pde.junit.runtime.uitestapplication";
31 |
32 | private File optionsFile;
33 |
34 | /** Boolean toggle to control whether to show Eclipse log or not. */
35 | private boolean consoleLog;
36 |
37 | private boolean debug;
38 |
39 | private int debugPort = 8998;
40 |
41 | private long testTimeoutSeconds = 60 * 60L;
42 |
43 | private String launcherVersion = "1.4.0.v20161219-1356";
44 |
45 | private List projectPattern;
46 |
47 | private Closure testClassClosure;
48 |
49 | private String application;
50 |
51 | private String product;
52 |
53 | public String getApplicationName() {
54 | return this.applicationName;
55 | }
56 |
57 | public void setApplicationName(String applicationName) {
58 | this.applicationName = applicationName;
59 | }
60 |
61 | public File getOptionsFile() {
62 | return this.optionsFile;
63 | }
64 |
65 | public void setOptionsFile(File optionsFile) {
66 | this.optionsFile = optionsFile;
67 | }
68 |
69 | public boolean isConsoleLog() {
70 | return this.consoleLog;
71 | }
72 |
73 | public void setConsoleLog(boolean consoleLog) {
74 | this.consoleLog = consoleLog;
75 | }
76 |
77 | public long getTestTimeoutSeconds() {
78 | return this.testTimeoutSeconds;
79 | }
80 |
81 | public void setTestTimeoutSeconds(long testTimeoutSeconds) {
82 | this.testTimeoutSeconds = testTimeoutSeconds;
83 | }
84 |
85 | public String getFragmentHost() {
86 | return this.fragmentHost;
87 | }
88 |
89 | public void setFragmentHost(String fragmentHost) {
90 | this.fragmentHost = fragmentHost;
91 | }
92 |
93 | public boolean isDebug() {
94 | return this.debug;
95 | }
96 |
97 | public void setDebug(boolean debug) {
98 | this.debug = debug;
99 | }
100 |
101 | public int getDebugPort() {
102 | return this.debugPort;
103 | }
104 |
105 | public void setDebugPort(int debugPort) {
106 | this.debugPort = debugPort;
107 | }
108 |
109 | public String getLauncherVersion() {
110 | return this.launcherVersion;
111 | }
112 |
113 | public void setLauncherVersion(String version) {
114 | this.launcherVersion = version;
115 | }
116 |
117 | public List getProjectPattern() {
118 | return this.projectPattern;
119 | }
120 |
121 | public void setProjectPattern(List pattern) {
122 | this.projectPattern = pattern;
123 | }
124 |
125 | public Closure getTestClassClosure() {
126 | return testClassClosure;
127 | }
128 |
129 | public void isTestClass(Closure testClassClosure) {
130 | this.testClassClosure = testClassClosure;
131 | }
132 |
133 | public String getApplication() {
134 | return application;
135 | }
136 |
137 | public void setApplication(String application) {
138 | this.application = application;
139 | }
140 |
141 | public String getProduct() {
142 | return product;
143 | }
144 |
145 | public void setProduct(String product) {
146 | this.product = product;
147 | }
148 | }
149 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/testing/PluginTestPortLocator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Donát Csikós (Gradle Inc.) - initial API and implementation and initial documentation
10 | */
11 |
12 | package de.monkeyworks.buildmonkey.pde.testing;
13 |
14 | import java.io.IOException;
15 | import java.net.ServerSocket;
16 |
17 | public final class PluginTestPortLocator {
18 |
19 | public int locatePluginTestPortNumber() {
20 | ServerSocket socket = null;
21 | try {
22 | socket = new ServerSocket(0);
23 | return socket.getLocalPort();
24 | } catch (IOException e) {
25 | // ignore
26 | } finally {
27 | if (socket != null) {
28 | try {
29 | socket.close();
30 | } catch (IOException e) {
31 | // ignore
32 | }
33 | }
34 | }
35 | return -1;
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/testing/UiTestExtension.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Donát Csikós (Gradle Inc.) - initial API and implementation and initial documentation
10 | */
11 |
12 | package de.monkeyworks.buildmonkey.pde.testing;
13 |
14 | import groovy.lang.Closure;
15 |
16 | import java.io.File;
17 |
18 | public class UiTestExtension {
19 |
20 | /**
21 | * Application launched in Eclipse.
22 | * {@code org.eclipse.swtbot.eclipse.core.swtbottestapplication} can be used to runUI tests with swt bot.
23 | */
24 | private String applicationName = "org.eclipse.swtbot.eclipse.core.swtbottestapplication";
25 |
26 | private String testClass;
27 |
28 | private String testBundle;
29 |
30 | private File optionsFile;
31 |
32 | /** Boolean toggle to control whether to show Eclipse log or not. */
33 | private boolean consoleLog;
34 |
35 | private boolean debug;
36 |
37 | private int debugPort = 8998;
38 |
39 | private long testTimeoutSeconds = 60 * 60L;
40 |
41 | private String application;
42 |
43 | private String product;
44 |
45 | private Closure testClassClosure;
46 |
47 | public String getApplicationName() {
48 | return this.applicationName;
49 | }
50 |
51 | public void setApplicationName(String applicationName) {
52 | this.applicationName = applicationName;
53 | }
54 |
55 | public File getOptionsFile() {
56 | return this.optionsFile;
57 | }
58 |
59 | public void setOptionsFile(File optionsFile) {
60 | this.optionsFile = optionsFile;
61 | }
62 |
63 | public boolean isConsoleLog() {
64 | return this.consoleLog;
65 | }
66 |
67 | public void setConsoleLog(boolean consoleLog) {
68 | this.consoleLog = consoleLog;
69 | }
70 |
71 | public long getTestTimeoutSeconds() {
72 | return this.testTimeoutSeconds;
73 | }
74 |
75 | public void setTestTimeoutSeconds(long testTimeoutSeconds) {
76 | this.testTimeoutSeconds = testTimeoutSeconds;
77 | }
78 |
79 | public boolean isDebug() {
80 | return this.debug;
81 | }
82 |
83 | public void setDebug(boolean debug) {
84 | this.debug = debug;
85 | }
86 |
87 | public int getDebugPort() {
88 | return this.debugPort;
89 | }
90 |
91 | public void setDebugPort(int debugPort) {
92 | this.debugPort = debugPort;
93 | }
94 |
95 | public String getApplication() {
96 | return application;
97 | }
98 |
99 | public void setApplication(String application) {
100 | this.application = application;
101 | }
102 |
103 | public String getProduct() {
104 | return product;
105 | }
106 |
107 | public void setProduct(String product) {
108 | this.product = product;
109 | }
110 |
111 | public String getTestClass() {
112 | return testClass;
113 | }
114 |
115 | public void setTestClass(String testClass) {
116 | this.testClass = testClass;
117 | }
118 |
119 | public String getTestBundle() {
120 | return testBundle;
121 | }
122 |
123 | public void setTestBundle(String testBundle) {
124 | this.testBundle = testBundle;
125 | }
126 |
127 | public Closure getTestClassClosure() {
128 | return testClassClosure;
129 | }
130 |
131 | public void isTestClass(Closure testClassClosure) {
132 | this.testClassClosure = testClassClosure;
133 | }
134 |
135 | }
136 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/tools/DownloadApplicationTask.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.pde.tools
9 |
10 | import org.gradle.api.DefaultTask
11 | import org.gradle.api.Project
12 | import org.gradle.api.tasks.TaskAction
13 | import org.gradle.internal.os.OperatingSystem
14 | import de.monkeyworks.buildmonkey.pde.utils.FileSemaphore
15 | //DUPLICATED, must be part of a common bundle
16 | class DownloadApplicationTask extends DefaultTask {
17 |
18 | String downloadUrl
19 | File targetFile
20 | File targetDir
21 |
22 | @TaskAction
23 | public void downloadApplication() {
24 | def directoryLock = new FileSemaphore(targetDir)
25 | directoryLock.lock()
26 | try {
27 | downloadApplicationUnprotected(getProject())
28 | } finally {
29 | directoryLock.unlock()
30 | }
31 | }
32 |
33 | private void downloadApplicationUnprotected(Project project) {
34 | // download the archive
35 | project.logger.info("Download application from '${downloadUrl}' to '${targetFile.absolutePath}'")
36 | project.ant.get(src: new URL(downloadUrl), dest: targetFile)
37 |
38 | // extract it to the same location where it was extracted
39 | def targetFolder = new File(targetFile.parentFile, 'application')
40 | if(!targetFolder.exists()) {
41 | targetFolder.mkdirs()
42 | }
43 |
44 | project.logger.info("Extract '$targetFile' to '$targetFile.parentFile.absolutePath'")
45 | if (OperatingSystem.current().isWindows()) {
46 | project.ant.unzip(src: targetFile, dest: targetFolder, overwrite: true)
47 | } else {
48 | project.ant.untar(src: targetFile, dest: targetFolder, compression: "gzip", overwrite: true)
49 | }
50 | }
51 |
52 | }
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/tools/DownloadEclipseSdkTask.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.pde.tools
9 |
10 | import java.io.File;
11 |
12 | import org.gradle.api.DefaultTask
13 | import org.gradle.api.Project
14 | import org.gradle.api.tasks.Input
15 | import org.gradle.api.tasks.OutputDirectory
16 | import org.gradle.api.tasks.OutputFile
17 | import org.gradle.api.tasks.TaskAction
18 | import org.gradle.internal.os.OperatingSystem
19 | import de.monkeyworks.buildmonkey.pde.utils.FileSemaphore
20 | //DUPLICATED, must be part of a common bundle
21 | class DownloadEclipseSdkTask extends DefaultTask {
22 |
23 | String downloadUrl
24 |
25 | File targetDir
26 |
27 | @TaskAction
28 | public void downloadSdk() {
29 | // if multiple builds start on the same machine (which is the case with a CI server)
30 | // we want to prevent them downloading the same file to the same destination
31 | def directoryLock = new FileSemaphore(targetDir)
32 | directoryLock.lock()
33 | try {
34 | downloadEclipseSdkUnprotected(getProject())
35 | } finally {
36 | directoryLock.unlock()
37 | }
38 | }
39 |
40 | private void downloadEclipseSdkUnprotected(Project project) {
41 | // download the archive
42 | File sdkArchive = eclipseSdkArchive()
43 | project.logger.info("Download Eclipse SDK from '${downloadUrl}' to '${sdkArchive.absolutePath}'")
44 | project.ant.get(src: new URL(downloadUrl), dest: sdkArchive)
45 |
46 | // extract it to the same location where it was extracted
47 | project.logger.info("Extract '$sdkArchive' to '$sdkArchive.parentFile.absolutePath'")
48 | if (OperatingSystem.current().isWindows()) {
49 | project.ant.unzip(src: sdkArchive, dest: sdkArchive.parentFile, overwrite: true)
50 | } else {
51 | project.ant.untar(src: sdkArchive, dest: sdkArchive.parentFile, compression: "gzip", overwrite: true)
52 | }
53 | }
54 |
55 | private File eclipseSdkArchive() {
56 | new File(targetDir, OperatingSystem.current().isWindows() ? 'eclipse-sdk.zip' : 'eclipse-sdk.tar.gz')
57 | }
58 | }
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/tools/FileHelper.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.pde.tools
9 |
10 | /**
11 | * Created by micha on 02.06.17.
12 | */
13 | class FileHelper {
14 |
15 | static File findSubFolder(File parent, String folderName) {
16 | if(parent == null || !parent.exists()) {
17 | return
18 | }
19 | File retval = null
20 | def files = parent.listFiles()
21 | files.each {
22 | if(it.isDirectory() && it.getName().equals(folderName)) {
23 | retval = it
24 | } else {
25 | File tmp = findSubFolder(it, folderName)
26 | if(tmp != null)
27 | retval = tmp
28 | }
29 | }
30 |
31 | return retval
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/groovy/de/monkeyworks/buildmonkey/pde/utils/FileSemaphore.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | *
8 | * Contributors:
9 | * Donát Csikós (Gradle Inc.) - initial API and implementation and initial documentation
10 | */
11 |
12 | package de.monkeyworks.buildmonkey.pde.utils
13 | //DUPLICATED, must be part of a common bundle
14 | import java.nio.channels.FileLock
15 |
16 | /**
17 | * Utility class for inter-process-synchronization by using a {@code FileLock} as a semaphore.
18 | *
19 | * When the {@link FileSemaphore#lock()} method is called, a .lock file is created under a given folder guarded by
20 | * the FileChannel.lock(). This lock can be released again by calling the {@link FileSemaphore#unlock()} method.
21 | */
22 | class FileSemaphore {
23 |
24 | final File directory
25 | FileOutputStream fos
26 | FileLock lock
27 |
28 | FileSemaphore(File directory) {
29 | this.directory = directory
30 | }
31 |
32 | def lock() {
33 | File lockFile = new File(directory, ".lock")
34 | if (!lockFile.exists()) {
35 | lockFile.getParentFile().mkdirs()
36 | lockFile.createNewFile()
37 | }
38 | fos = new FileOutputStream(lockFile)
39 | lock = fos.getChannel().lock()
40 | }
41 |
42 | def unlock() {
43 | lock.release()
44 | fos.close()
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.pde.PluginTestPlugin.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 the original author or authors.
3 | # All rights reserved. This program and the accompanying materials
4 | # are made available under the terms of the Eclipse Public License v1.0
5 | # which accompanies this distribution, and is available at
6 | # http://www.eclipse.org/legal/epl-v10.html
7 | #
8 |
9 | implementation-class=de.monkeyworks.buildmonkey.pde.PluginTestPlugin
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.pde.TestDefinitionPlugin.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 the original author or authors.
3 | # All rights reserved. This program and the accompanying materials
4 | # are made available under the terms of the Eclipse Public License v1.0
5 | # which accompanies this distribution, and is available at
6 | # http://www.eclipse.org/legal/epl-v10.html
7 | #
8 |
9 | implementation-class=de.monkeyworks.buildmonkey.pde.TestDefinitionPlugin
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.pde.UITestDefinitionPlugin.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 the original author or authors.
3 | # All rights reserved. This program and the accompanying materials
4 | # are made available under the terms of the Eclipse Public License v1.0
5 | # which accompanies this distribution, and is available at
6 | # http://www.eclipse.org/legal/epl-v10.html
7 | #
8 |
9 | implementation-class=de.monkeyworks.buildmonkey.pde.UITestDefinitionPlugin
--------------------------------------------------------------------------------
/materialisation/gradle.pde/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.pde.UiTestPlugin.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 the original author or authors.
3 | # All rights reserved. This program and the accompanying materials
4 | # are made available under the terms of the Eclipse Public License v1.0
5 | # which accompanies this distribution, and is available at
6 | # http://www.eclipse.org/legal/epl-v10.html
7 | #
8 |
9 | implementation-class=de.monkeyworks.buildmonkey.pde.UiTestPlugin
--------------------------------------------------------------------------------
/materialisation/product/src/main/groovy/de/monkeyworks/buildmonkey/product/publish/ProductExtension.groovy:
--------------------------------------------------------------------------------
1 | package de.monkeyworks.buildmonkey.product.publish
2 |
3 | /**
4 | * Created by jake on 06/03/2017.
5 | */
6 | class ProductExtension {
7 | }
8 |
--------------------------------------------------------------------------------
/materialisation/product/src/main/groovy/de/monkeyworks/buildmonkey/product/publish/ProductPublishPlugin.groovy:
--------------------------------------------------------------------------------
1 | package de.monkeyworks.buildmonkey.product.publish
2 |
3 | /**
4 | * Created by jake on 06/03/2017.
5 | */
6 | class ProductPublishPlugin {
7 | }
8 |
--------------------------------------------------------------------------------
/materialisation/product/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.ProductPublishPlugin.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MONKEY-WORKS/BuildMonkey/a0deaf33613036af8d8561dc9f63540cb5887998/materialisation/product/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.ProductPublishPlugin.properties
--------------------------------------------------------------------------------
/osgi/manifestUpdater/build.gradle:
--------------------------------------------------------------------------------
1 | version '0.0.1'
2 |
3 | sourceCompatibility = 1.8
4 |
5 | dependencies {
6 | compile 'de.monkeyworks.buildmonkey:base:1.0.3'
7 | }
--------------------------------------------------------------------------------
/osgi/manifestUpdater/src/main/groovy/de/monkeyworks/buildmonkey/osgi/ManifestUpdater.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.osgi
9 |
10 | import org.gradle.api.Plugin
11 | import org.gradle.api.Project
12 |
13 | import java.util.jar.Manifest
14 |
15 | /**
16 | *
17 | * Update manifest files
18 | *
19 | * Created by Johannes Tandler on 02.06.17.
20 | */
21 | class ManifestUpdater implements Plugin {
22 |
23 | @Override
24 | void apply(Project project) {
25 | project.extensions.create("manifestUpdate", ManifestUpdaterExtension)
26 |
27 | addBundleVersionUpdate(project)
28 | addDependencyVersionUpdate(project)
29 | }
30 |
31 | /**
32 | * task to update osgi versions
33 | * @param project
34 | */
35 | void addDependencyVersionUpdate(Project project) {
36 | project.tasks.create("updateDependencyVersions") { task ->
37 | task.description = "Updates the dependency version inside the manifest files"
38 |
39 | task.doLast {
40 | ManifestUpdaterExtension config = project.extensions.manifestUpdate
41 | if(!config.dependencyUpdates)
42 | return
43 |
44 |
45 | File file = new File("${project.projectDir}/META-INF/MANIFEST.MF")
46 | FileInputStream fis = new FileInputStream(file)
47 | Manifest manifest = new Manifest(fis)
48 | fis.close()
49 |
50 | ManifestParser parser = new ManifestParser(manifest)
51 | List bundles = parser.parseRequireBundles()
52 |
53 | String newRequireBundleString = null
54 |
55 | for(RequiredBundle bundle : bundles) {
56 | String newVersion = config.dependencyUpdates(bundle.bundleName)
57 | if(newVersion != null) {
58 | bundle.attributes.put("bundle-version", newVersion)
59 | }
60 |
61 | if(newRequireBundleString)
62 | newRequireBundleString += ","
63 | else
64 | newRequireBundleString = ""
65 |
66 | newRequireBundleString += bundle.toString()
67 | }
68 |
69 | if(newRequireBundleString)
70 | manifest.getMainAttributes().putValue("Require-Bundle", newRequireBundleString)
71 |
72 | FileOutputStream fos = new FileOutputStream(file)
73 | manifest.write(fos)
74 | fos.close()
75 | }
76 | }
77 | }
78 |
79 | /**
80 | * task to update bundle version itself
81 | * @param project
82 | */
83 | void addBundleVersionUpdate(Project project) {
84 | project.tasks.create("setManifestVersion") { task ->
85 | task.description = "Set's the Bundle-Version attribute of the given MANIFEST.MF"
86 |
87 | task.doLast {
88 | ManifestUpdaterExtension config = project.extensions.manifestUpdate
89 | if(!config.version)
90 | return
91 |
92 | File file = new File("${project.projectDir}/META-INF/MANIFEST.MF")
93 | FileInputStream fis = new FileInputStream(file)
94 | Manifest manifest = new Manifest(fis)
95 | fis.close()
96 |
97 | String newVersion = config.version
98 | if(config.addQualifier && !newVersion.endsWith(".qualifier")) {
99 | newVersion += ".qualifier"
100 | }
101 |
102 | manifest.getMainAttributes().putValue("Bundle-Version", newVersion)
103 |
104 | FileOutputStream fos = new FileOutputStream(file)
105 | manifest.write(fos)
106 | fos.close()
107 | }
108 | }
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/osgi/manifestUpdater/src/main/groovy/de/monkeyworks/buildmonkey/osgi/ManifestUpdaterExtension.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.osgi
9 |
10 | /**
11 | * Created by jake on 02.06.17.
12 | */
13 | class ManifestUpdaterExtension {
14 |
15 | String version
16 |
17 | boolean addQualifier = true
18 |
19 | Closure dependencyUpdates
20 |
21 |
22 | void depdencyUpdate(Closure closure) {
23 | dependencyUpdates = closure
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/osgi/manifestUpdater/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.osgi.ManifestUpdater.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 the original author or authors.
3 | # All rights reserved. This program and the accompanying materials
4 | # are made available under the terms of the Eclipse Public License v1.0
5 | # which accompanies this distribution, and is available at
6 | # http://www.eclipse.org/legal/epl-v10.html
7 | #
8 |
9 |
10 | implementation-class=de.monkeyworks.buildmonkey.osgi.ManifestUpdater
11 |
--------------------------------------------------------------------------------
/repository/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/repository/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | repository
4 | Project repository created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 | org.eclipse.jdt.groovy.core.groovyNature
17 | org.eclipse.jdt.core.javanature
18 |
19 |
20 |
--------------------------------------------------------------------------------
/repository/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | build.commands=org.eclipse.jdt.core.javabuilder
2 | connection.arguments=
3 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
4 | connection.java.home=null
5 | connection.jvm.arguments=
6 | connection.project.dir=..
7 | containers=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/
8 | derived.resources=.gradle,build
9 | eclipse.preferences.version=1
10 | natures=org.eclipse.jdt.groovy.core.groovyNature,org.eclipse.jdt.core.javanature
11 | project.path=\:repository
12 |
--------------------------------------------------------------------------------
/repository/.settings/org.eclipse.jdt.groovy.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | groovy.compiler.level=24
3 |
--------------------------------------------------------------------------------
/repository/gradle.mavenize/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/repository/gradle.mavenize/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | gradle.mavenize
4 | Project gradle.mavenize created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 | org.eclipse.jdt.groovy.core.groovyNature
17 | org.eclipse.jdt.core.javanature
18 |
19 |
20 |
--------------------------------------------------------------------------------
/repository/gradle.mavenize/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | build.commands=org.eclipse.jdt.core.javabuilder
2 | connection.arguments=
3 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
4 | connection.java.home=null
5 | connection.jvm.arguments=
6 | connection.project.dir=../..
7 | containers=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/
8 | derived.resources=.gradle,build
9 | eclipse.preferences.version=1
10 | natures=org.eclipse.jdt.groovy.core.groovyNature,org.eclipse.jdt.core.javanature
11 | project.path=\:repository\:gradle.mavenize
12 |
--------------------------------------------------------------------------------
/repository/gradle.mavenize/.settings/org.eclipse.jdt.groovy.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | groovy.compiler.level=24
3 |
--------------------------------------------------------------------------------
/repository/gradle.mavenize/build.gradle:
--------------------------------------------------------------------------------
1 | dependencies {
2 | compile 'org.apache.maven:maven-ant-tasks:2.1.3'
3 | compile 'org.osgi:org.eclipse.osgi:3.10.100.v20150529-1857'
4 |
5 | // compile project(':gradle.p2')
6 |
7 | }
8 | version = '0.4.2'
9 | apply plugin: "com.gradle.plugin-publish"
10 |
11 | pluginBundle {
12 | website = 'https://github.com/MONKEY-WORKS/BuildMonkey/wiki'
13 | vcsUrl = 'https://github.com/MONKEY-WORKS/BuildMonkey'
14 |
15 | plugins {
16 | mavenizerPlugin {
17 | description = 'Create maven repositories from p2'
18 | tags = ['MAVEN', 'eclipse', 'P2']
19 | id = 'de.monkeyworks.buildmonkey.mavenizer.MavenizerPlugin'
20 | displayName = 'Mavenize p2 repository plugin'
21 | }
22 | }
23 | mavenCoordinates {
24 | groupId = "de.monkeyworks.buildmonkey"
25 | }
26 | }
27 |
28 | publishPlugins.dependsOn(build)
29 |
--------------------------------------------------------------------------------
/repository/gradle.mavenize/src/main/groovy/de/monkeyworks/buildmonkey/mavenizer/MavenizerPlugin.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.mavenizer
9 |
10 | import de.monkeyworks.buildmonkey.mavenizer.mavenize.BundleMavenDeployer
11 | import org.gradle.api.Plugin
12 | import org.gradle.api.Project
13 |
14 |
15 | class MavenizeTaskExtension {
16 | String sourceP2Repository
17 | String targetDir
18 | String groupId
19 | boolean useP2MirrorOutput
20 |
21 | Project project
22 |
23 | MavenizeTaskExtension(Project project) {
24 | groupId = "eclipse"
25 | targetDir = "build/m2-repository"
26 | sourceP2Repository = ""
27 | useP2MirrorOutput = false
28 | this.project = project
29 | }
30 | }
31 |
32 | class MavenizeExtension {
33 | def mavenizeTasks = []
34 | def project
35 |
36 | MavenizeExtension(Project project) {
37 | this.project = project
38 | }
39 |
40 | void mavenizeTask(Closure closure) {
41 | def task = new MavenizeTaskExtension()
42 | project.configure(task, closure)
43 | mavenizeTasks.add(task)
44 | }
45 | }
46 |
47 | class MavenizerPlugin implements Plugin {
48 |
49 | static final String TASK_NAME_CONVERT_P2_M2 = "mavenizeP2Repository"
50 | // Must be a common constant
51 | static final String TASK_NAME_MIRROR_P2 = "mirrorP2Repository"
52 |
53 | @Override
54 | public void apply(Project project) {
55 | project.extensions.create("mavenize", MavenizeExtension, project)
56 |
57 | def name = TASK_NAME_CONVERT_P2_M2
58 | def rootTask = project.tasks.create(name)
59 |
60 | project.afterEvaluate {
61 | MavenizeExtension config = project.mavenize
62 |
63 | // create clan task if necessary
64 | if (project.tasks.findByPath('clean') == null) {project.tasks.create('clean')}
65 |
66 | def i = 1
67 | for(MavenizeTaskExtension task : config.mavenizeTasks) {
68 | def cleanTask = project.task("cleanM2Repository_$i") {
69 | doFirst {
70 | MavenizeExtension parameter = project.mavenize
71 | new File(task.targetDir).deleteDir()
72 | }
73 | }
74 | project.tasks.clean.dependsOn cleanTask
75 |
76 | project.task(name + "_$i") {
77 | description = "Converts created p2 repository into m2 repository"
78 |
79 | if(task.useP2MirrorOutput) {
80 | def p2Repo = "$project.eclipseMirror.target"
81 | if(p2Repo != null && p2Repo != "null")
82 | task.sourceP2Repository = p2Repo
83 | // task should depend on publish p2 task then
84 | it.dependsOn("mirrorP2Repository")
85 | }
86 |
87 | doLast {
88 |
89 | def converter = new BundleMavenDeployer(project.ant, task.groupId, project.logger)
90 | converter.deploy(new File(task.sourceP2Repository), new File(task.targetDir))
91 | }
92 | }
93 | rootTask.dependsOn(name + "_$i")
94 |
95 | i++
96 | }
97 | }
98 | }
99 | }
--------------------------------------------------------------------------------
/repository/gradle.mavenize/src/main/groovy/de/monkeyworks/buildmonkey/mavenizer/mavenize/Bundle2Pom.groovy:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 Andrey Hihlovskiy
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | */
14 |
15 | package de.monkeyworks.buildmonkey.mavenizer.mavenize
16 |
17 | import java.util.jar.JarFile
18 | import java.util.jar.Manifest
19 | import org.osgi.framework.Constants
20 |
21 | /**
22 | * Converts bundle manifest to POM.
23 | */
24 | final class Bundle2Pom {
25 | String group
26 | String dependencyGroup
27 |
28 | /**
29 | * Constructs Bundle2Pom object with the specified parameters.
30 | * @param group - maven group to which the given artifact belongs.
31 | * @param dependencyGroup - maven group to which the dependencies of the given artifact belong.
32 | */
33 | Bundle2Pom(String group = null, String dependencyGroup = null) {
34 | this.group = group
35 | this.dependencyGroup = dependencyGroup
36 | }
37 |
38 | /**
39 | * Converts bundle to POM.
40 | * @param bundleFileOrDirectory - jar-file or directory containing OSGi bundle.
41 | * @return the converted POM.
42 | */
43 | Pom convert(File bundleFileOrDirectory) {
44 | def pom = new Pom()
45 | def manifest
46 | if (bundleFileOrDirectory.isDirectory()) {
47 | new File(bundleFileOrDirectory, 'META-INF/MANIFEST.MF').withInputStream {
48 | manifest = new Manifest(it)
49 | }
50 | pom.packaging = 'dir'
51 | } else
52 | manifest = new JarFile(bundleFileOrDirectory).manifest
53 |
54 | pom.artifact = manifest.attr.getValue(Constants.BUNDLE_SYMBOLICNAME)
55 | if (pom.artifact.contains(';'))
56 | pom.artifact = pom.artifact.split(';')[0]
57 | pom.artifact = pom.artifact.trim()
58 |
59 | pom.group = group ?: pom.artifact
60 | pom.dependencyGroup = dependencyGroup
61 |
62 | // cut the qualifier and use only the major.minor.service segments as version number
63 | // this is in sync with version constraints declared in the bundle manifest
64 | def version = new Version(manifest.attr.getValue(Constants.BUNDLE_VERSION))
65 | pom.version = "${version.major}.${version.minor}.${version.release}"
66 |
67 | parseDependencyBundles(pom.dependencyBundles, manifest.attr.getValue(Constants.REQUIRE_BUNDLE))
68 |
69 | return pom
70 | }
71 |
72 | private DependencyBundle parseDependencyBundle(String string) {
73 | List elements = string.split(';')
74 | String name = elements[0]
75 | elements.remove(0)
76 | DependencyBundle bundle = new DependencyBundle(name: name, resolution: Constants.RESOLUTION_MANDATORY, visibility: Constants.VISIBILITY_PRIVATE, version: "[1.0,)")
77 | for(String element in elements)
78 | if (element.startsWith(Constants.BUNDLE_VERSION_ATTRIBUTE)) {
79 | String s = element.substring(element.indexOf('=') + 1)
80 | if(s.startsWith('"'))
81 | s = s.substring(1)
82 | if(s.endsWith('"'))
83 | s = s.substring(0, s.length() - 1)
84 | bundle.version = s
85 | } else if (element.startsWith(Constants.RESOLUTION_DIRECTIVE))
86 | bundle.resolution = element.substring(element.indexOf('=') + 1)
87 | else if (element.startsWith(Constants.VISIBILITY_DIRECTIVE))
88 | bundle.visibility = element.substring(element.indexOf('=') + 1)
89 | return bundle
90 | }
91 |
92 | private void parseDependencyBundles(List depBundles, String depBundlesString) {
93 | if(!depBundlesString)
94 | return
95 | int startPos = 0
96 | boolean quoted = false
97 | for(int i = 0; i < depBundlesString.length(); i++) {
98 | char c = depBundlesString.charAt(i)
99 | if(c == ',' && !quoted) {
100 | depBundles.add(parseDependencyBundle(depBundlesString.substring(startPos, i)))
101 | startPos = i + 1
102 | } else if(c == '"')
103 | quoted = !quoted
104 | }
105 | if(startPos < depBundlesString.length())
106 | depBundles.add(parseDependencyBundle(depBundlesString.substring(startPos, depBundlesString.length())))
107 | }
108 | }
109 |
110 |
--------------------------------------------------------------------------------
/repository/gradle.mavenize/src/main/groovy/de/monkeyworks/buildmonkey/mavenizer/mavenize/DependencyBundle.groovy:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 Andrey Hihlovskiy
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | */
14 |
15 | package de.monkeyworks.buildmonkey.mavenizer.mavenize
16 |
17 | import groovy.transform.ToString
18 |
19 | /**
20 | * POJO class holding data on dependency bundle. Used by {@link org.akhikhl.unpuzzle.osgi2maven.Pom} class.
21 | */
22 | @ToString
23 | public final class DependencyBundle {
24 | String group
25 | String name
26 | String version
27 | String visibility
28 | String resolution
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/repository/gradle.mavenize/src/main/groovy/de/monkeyworks/buildmonkey/mavenizer/mavenize/DeployMavenAntTaskExecutor.groovy:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 Andrey Hihlovskiy
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | */
14 |
15 | package de.monkeyworks.buildmonkey.mavenizer.mavenize
16 |
17 | import org.apache.maven.artifact.ant.Mvn;
18 |
19 | /**
20 | * Deploys OSGI bundle (jar or directory) to maven repository
21 | */
22 | class DeployMavenAntTaskExecutor {
23 | final AntBuilder ant
24 | final File target
25 | final File workFolder
26 |
27 | /**
28 | * Constructs Deployer with the specified parameters.
29 | */
30 | DeployMavenAntTaskExecutor(AntBuilder ant, File target) {
31 | this.ant = ant
32 | this.ant.taskdef(resource: 'org/apache/maven/artifact/ant/antlib.xml', classpath: Mvn.class.getProtectionDomain().getCodeSource().getLocation())
33 | this.target = target
34 | this.workFolder = new File(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString())
35 | }
36 |
37 | /**
38 | * Deploys the specified bundle with the specified POM to target maven repository.
39 | * @param options - may contain sourceFile (of type java.io.File), pointing to sources jar.
40 | * @param pomStruct - contains POM that will be used for deployment
41 | * @param bundleFileOrDirectory - jar-file or directory, containing OSGI bundle
42 | */
43 | void deployBundle(Map options = [:], Pom pomStruct, File bundleFileOrDirectory) {
44 | workFolder.mkdirs()
45 | String temporaryM2FolderPath = new File(workFolder, ".m2").absolutePath
46 | def pomFile = new File(workFolder, 'myPom.xml')
47 | File bundleFile
48 | if (bundleFileOrDirectory.isDirectory()) {
49 | pomStruct.packaging = 'jar'
50 | pomFile.text = pomStruct.toString()
51 | File zipFile = new File(workFolder, "${pomStruct.artifact}-${pomStruct.version}.jar")
52 | ant.zip(basedir: bundleFileOrDirectory, destfile: zipFile)
53 | bundleFile = zipFile
54 | }
55 | else {
56 | pomFile.text = pomStruct.toString()
57 | bundleFile = bundleFileOrDirectory
58 | }
59 | File sourceFile = options.sourceFile
60 | if(sourceFile?.isDirectory()) {
61 | File zipFile = new File(workFolder, sourceFile.name + '.jar')
62 | ant.zip(basedir: sourceFile, destfile: zipFile)
63 | sourceFile = zipFile
64 | }
65 | ant.with {
66 | pom id: 'mypom', file: pomFile
67 | deploy file: bundleFile, {
68 | pom refid: 'mypom'
69 | if(sourceFile)
70 | attach file: sourceFile, type: 'jar', classifier: 'sources'
71 |
72 | localRepository id:"local.repository", path: temporaryM2FolderPath, layout:"default"
73 | remoteRepository url: this.target.toURI().toURL().toString(), {}
74 | }
75 | }
76 | }
77 |
78 | void cleanup() {
79 | // delete the working directory
80 | if(workFolder.exists()){
81 | workFolder.deleteDir()
82 | }
83 | // clean up md5 sum files generated by the ant maven deploy task
84 | new File(System.getProperty('java.io.tmpdir')).eachFileMatch(~/maven-artifact\d+\.tmp/) { it.delete() }
85 | }
86 | }
87 |
88 |
--------------------------------------------------------------------------------
/repository/gradle.mavenize/src/main/groovy/de/monkeyworks/buildmonkey/mavenizer/mavenize/Feature2Pom.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.mavenizer.mavenize
9 |
10 | import groovy.util.slurpersupport.GPathResult
11 | import org.osgi.framework.Constants
12 |
13 | import java.util.jar.JarFile
14 |
15 | /**
16 | * Created by jake on 14/03/2017.
17 | */
18 | class Feature2Pom {
19 | String group
20 | String dependencyGroup
21 |
22 |
23 | Feature2Pom(String group = null, String dependencyGroup = null) {
24 | this.group = group
25 | this.dependencyGroup = dependencyGroup
26 | }
27 |
28 | /**
29 | * Converts bundle to POM.
30 | * @param bundleFileOrDirectory - jar-file or directory containing OSGi bundle.
31 | * @return the converted POM.
32 | */
33 | Pom convert(File bundleFileOrDirectory) {
34 | def pom = new Pom()
35 | def featurexmlStream
36 |
37 | if (bundleFileOrDirectory.isDirectory()) {
38 | featurexmlStream = new FileInputStream(new File(bundleFileOrDirectory, 'feature.xml'))
39 | pom.packaging = 'dir'
40 | } else {
41 | def jarFile = new JarFile(bundleFileOrDirectory)
42 | featurexmlStream = jarFile.getInputStream(jarFile.getJarEntry("feature.xml"))
43 | }
44 |
45 | def parsedXML = new XmlSlurper().parse(featurexmlStream)
46 | featurexmlStream.close()
47 |
48 | pom.artifact = parsedXML['@id']
49 |
50 | pom.group = group ?: pom.artifact
51 | def version = new Version(parsedXML['@version'].toString())
52 | pom.version = "${version.major}.${version.minor}.${version.release}"
53 |
54 | parseDependencies(pom.dependencyBundles, parsedXML)
55 |
56 | return pom
57 | }
58 |
59 | /**
60 | *
61 | * This method extracts dependencies from a given feature xml using a node name for identifying elements that hold a dependency
62 | * and an attribute which holds the artifact name
63 | *
64 | * @param depBundles
65 | * @param xml
66 | */
67 | private void parseDependencies(List depBundles, GPathResult xml) {
68 | def extractDependenciesFromXML = { nodeName, attribute ->
69 | xml.'**'.findAll{ node-> node.name() == nodeName}.forEach { plugin ->
70 | depBundles.add(new DependencyBundle(name: plugin["@${attribute}"], resolution: Constants.RESOLUTION_MANDATORY, visibility: Constants.VISIBILITY_PRIVATE, version: "[1.0,)"))
71 | }
72 | }
73 |
74 | extractDependenciesFromXML("plugin", "id")
75 | extractDependenciesFromXML("import", "plugin")
76 | extractDependenciesFromXML("includes", "id")
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/repository/gradle.mavenize/src/main/groovy/de/monkeyworks/buildmonkey/mavenizer/mavenize/Pom.groovy:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 Andrey Hihlovskiy
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | */
14 |
15 | package de.monkeyworks.buildmonkey.mavenizer.mavenize
16 |
17 | import groovy.xml.MarkupBuilder
18 | import org.osgi.framework.Constants
19 |
20 | /**
21 | * POJO class holding data extracted from bundle and needed for POM generation.
22 | */
23 | public final class Pom {
24 | private static final String encoding = 'UTF-8'
25 |
26 | String group
27 | String artifact
28 | String version
29 | String packaging = 'jar'
30 | List dependencyBundles = []
31 | String dependencyGroup
32 |
33 | String toString() {
34 | ByteArrayOutputStream stm = new ByteArrayOutputStream()
35 | writeTo(new OutputStreamWriter(stm, encoding))
36 | String result = stm.toString(encoding)
37 | if(result.charAt(0) == 0xfeff)
38 | result = result.substring(1) // remove BOM, if present
39 | return result
40 | }
41 |
42 | void writeTo(Writer writer) {
43 | def builder = new MarkupBuilder(writer)
44 | builder.mkp.xmlDeclaration(version: '1.0', encoding: encoding)
45 | def pom = this
46 | builder.project xmlns: 'http://maven.apache.org/POM/4.0.0', 'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance', {
47 | modelVersion '4.0.0'
48 | if(pom.group)
49 | groupId pom.group
50 | if(pom.artifact)
51 | artifactId pom.artifact
52 | if(pom.version)
53 | version pom.version
54 | if(pom.packaging != 'jar')
55 | packaging pom.packaging
56 | if(pom.dependencyBundles)
57 | dependencies {
58 | for(def depBundle in pom.dependencyBundles)
59 | dependency {
60 | if(depBundle.group)
61 | groupId depBundle.group
62 | else if(dependencyGroup)
63 | groupId dependencyGroup
64 | else
65 | groupId pom.group
66 | artifactId depBundle.name
67 | if(depBundle.version)
68 | version depBundle.version
69 | scope 'compile'
70 | if(depBundle.resolution == Constants.RESOLUTION_OPTIONAL)
71 | optional true
72 | }
73 | }
74 | }
75 | }
76 | }
77 |
78 |
--------------------------------------------------------------------------------
/repository/gradle.mavenize/src/main/groovy/de/monkeyworks/buildmonkey/mavenizer/mavenize/Version.groovy:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2014 Andrey Hihlovskiy
3 | *
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
5 | * of this software and associated documentation files (the "Software"), to deal
6 | * in the Software without restriction, including without limitation the rights
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | * copies of the Software, and to permit persons to whom the Software is
9 | * furnished to do so, subject to the following conditions:
10 | *
11 | * The above copyright notice and this permission notice shall be included in
12 | * all copies or substantial portions of the Software.
13 | */
14 |
15 | package de.monkeyworks.buildmonkey.mavenizer.mavenize
16 |
17 | /**
18 | * OSGi-specific version.
19 | */
20 | final class Version {
21 | long major = 0, minor = 0, release = 0
22 | String suffix = ''
23 |
24 | Version(de.monkeyworks.buildmonkey.mavenizer.mavenize.Pom pom) {
25 | init(pom.version)
26 | }
27 |
28 | Version(String versionStr) {
29 | init(versionStr)
30 | }
31 |
32 | int compare(Version other) {
33 | int result = major - other.major
34 | if(result != 0)
35 | return result
36 | result = minor - other.minor
37 | if(result != 0)
38 | return result
39 | result = release - other.release
40 | if(result != 0)
41 | return result
42 | return suffix.compareTo(other.suffix)
43 | }
44 |
45 | private void init(String versionStr) {
46 | def m = versionStr =~ /(\d+)(\.(\d+))?(\.(\d+))?(\.(.+))?/
47 | if(m) {
48 | major = Long.valueOf(m[0][1] ?: '0')
49 | minor = Long.valueOf(m[0][3] ?: '0')
50 | release = Long.valueOf(m[0][5] ?: '0')
51 | suffix = m[0][7] ?: ''
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/repository/gradle.mavenize/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.mavenizer.MavenizerPlugin.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 the original author or authors.
3 | # All rights reserved. This program and the accompanying materials
4 | # are made available under the terms of the Eclipse Public License v1.0
5 | # which accompanies this distribution, and is available at
6 | # http://www.eclipse.org/legal/epl-v10.html
7 | #
8 |
9 | implementation-class=de.monkeyworks.buildmonkey.mavenizer.MavenizerPlugin
--------------------------------------------------------------------------------
/repository/gradle.p2/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/repository/gradle.p2/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | gradle.p2
4 | Project gradle.p2 created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 | org.eclipse.jdt.groovy.core.groovyNature
17 | org.eclipse.jdt.core.javanature
18 |
19 |
20 |
--------------------------------------------------------------------------------
/repository/gradle.p2/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | build.commands=org.eclipse.jdt.core.javabuilder
2 | connection.arguments=
3 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
4 | connection.java.home=null
5 | connection.jvm.arguments=
6 | connection.project.dir=../..
7 | containers=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/
8 | derived.resources=.gradle,build
9 | eclipse.preferences.version=1
10 | natures=org.eclipse.jdt.groovy.core.groovyNature,org.eclipse.jdt.core.javanature
11 | project.path=\:repository\:gradle.p2
12 |
--------------------------------------------------------------------------------
/repository/gradle.p2/.settings/org.eclipse.jdt.groovy.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | groovy.compiler.level=24
3 |
--------------------------------------------------------------------------------
/repository/gradle.p2/build.gradle:
--------------------------------------------------------------------------------
1 | repositories {
2 | jcenter()
3 | }
4 |
5 | dependencies {
6 | compile 'org.apache.maven:maven-ant-tasks:2.1.3'
7 | compile 'org.osgi:org.eclipse.osgi:3.10.100.v20150529-1857'
8 | compile 'de.monkeyworks.buildmonkey:base:1.0.4'
9 | }
10 |
11 | apply plugin: "com.gradle.plugin-publish"
12 | version = "0.4.3"
13 | pluginBundle {
14 | website = 'https://github.com/MONKEY-WORKS/BuildMonkey/wiki'
15 | vcsUrl = 'https://github.com/MONKEY-WORKS/BuildMonkey'
16 |
17 | plugins {
18 | p2Plugin {
19 | description = 'Create P2 repository from certain P2 repositories'
20 | tags = ['eclipse', 'P2', 'repository']
21 | id = 'de.monkeyworks.buildmonkey.p2.P2MirrorPlugin'
22 | displayName = 'P2 repository creator plugin'
23 | }
24 | }
25 | mavenCoordinates {
26 | groupId = "de.monkeyworks.buildmonkey"
27 | }
28 | }
29 |
30 | publishPlugins.dependsOn(build)
31 |
--------------------------------------------------------------------------------
/repository/gradle.p2/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.p2.P2MirrorPlugin.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 the original author or authors.
3 | # All rights reserved. This program and the accompanying materials
4 | # are made available under the terms of the Eclipse Public License v1.0
5 | # which accompanies this distribution, and is available at
6 | # http://www.eclipse.org/legal/epl-v10.html
7 | #
8 |
9 | implementation-class=de.monkeyworks.buildmonkey.p2.P2MirrorPlugin
--------------------------------------------------------------------------------
/repository/gradle.p2publish/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/repository/gradle.p2publish/.gradletasknamecache:
--------------------------------------------------------------------------------
1 | assemble
2 | build
3 | buildDependents
4 | buildNeeded
5 | classes
6 | clean
7 | jar
8 | publishPluginGroovyDocsJar
9 | publishPluginJar
10 | publishPluginJavaDocsJar
11 | testClasses
12 | groovydoc
13 | javadoc
14 | buildEnvironment
15 | components
16 | dependencies
17 | dependencyInsight
18 | dependentComponents
19 | help
20 | model
21 | projects
22 | properties
23 | tasks
24 | cleanEclipse
25 | eclipse
26 | downloadLicenses
27 | license
28 | licenseFormat
29 | login
30 | publishPlugins
31 | generatePomFileForMavenGroovyPublication
32 | publish
33 | publishMavenGroovyPublicationToMavenLocal
34 | publishToMavenLocal
35 | check
36 | test
37 | cleanEclipseClasspath
38 | cleanEclipseJdt
39 | cleanEclipseProject
40 | compileGroovy
41 | compileJava
42 | compileTestGroovy
43 | compileTestJava
44 | eclipseClasspath
45 | eclipseJdt
46 | eclipseProject
47 | install
48 | licenseFormatMain
49 | licenseFormatTest
50 | licenseMain
51 | licenseTest
52 | processResources
53 | processTestResources
54 | Pattern:
55 | Pattern:
56 | Pattern:
57 | assemble
58 | build
59 | buildDependents
60 | buildNeeded
61 | classes
62 | clean
63 | jar
64 | publishPluginGroovyDocsJar
65 | publishPluginJar
66 | publishPluginJavaDocsJar
67 | testClasses
68 | groovydoc
69 | javadoc
70 | buildEnvironment
71 | components
72 | dependencies
73 | dependencyInsight
74 | dependentComponents
75 | help
76 | model
77 | projects
78 | properties
79 | tasks
80 | cleanEclipse
81 | eclipse
82 | downloadLicenses
83 | license
84 | licenseFormat
85 | login
86 | publishPlugins
87 | generatePomFileForMavenGroovyPublication
88 | publish
89 | publishMavenGroovyPublicationToMavenLocal
90 | publishToMavenLocal
91 | check
92 | test
93 | cleanEclipseClasspath
94 | cleanEclipseJdt
95 | cleanEclipseProject
96 | compileGroovy
97 | compileJava
98 | compileTestGroovy
99 | compileTestJava
100 | eclipseClasspath
101 | eclipseJdt
102 | eclipseProject
103 | install
104 | licenseFormatMain
105 | licenseFormatTest
106 | licenseMain
107 | licenseTest
108 | processResources
109 | processTestResources
110 |
--------------------------------------------------------------------------------
/repository/gradle.p2publish/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | gradle.p2publish
4 | Project gradle.p2publish created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 | org.eclipse.jdt.groovy.core.groovyNature
17 | org.eclipse.jdt.core.javanature
18 |
19 |
20 |
--------------------------------------------------------------------------------
/repository/gradle.p2publish/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | build.commands=org.eclipse.jdt.core.javabuilder
2 | connection.arguments=
3 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
4 | connection.java.home=null
5 | connection.jvm.arguments=
6 | connection.project.dir=../..
7 | containers=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/
8 | derived.resources=.gradle,build
9 | eclipse.preferences.version=1
10 | natures=org.eclipse.jdt.groovy.core.groovyNature,org.eclipse.jdt.core.javanature
11 | project.path=\:repository\:gradle.p2publish
12 |
--------------------------------------------------------------------------------
/repository/gradle.p2publish/.settings/org.eclipse.jdt.groovy.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | groovy.compiler.level=24
3 |
--------------------------------------------------------------------------------
/repository/gradle.p2publish/build.gradle:
--------------------------------------------------------------------------------
1 | sourceCompatibility = 1.8
2 |
3 | repositories {
4 | mavenCentral()
5 | }
6 |
7 | dependencies {
8 | compile gradleApi()
9 | compile localGroovy()
10 | compile 'de.monkeyworks.buildmonkey:base:1.0.4'
11 | }
12 |
13 |
14 | apply plugin: "com.gradle.plugin-publish"
15 | version = "0.4.12"
16 | pluginBundle {
17 | website = 'https://github.com/MONKEY-WORKS/BuildMonkey/wiki'
18 | vcsUrl = 'https://github.com/MONKEY-WORKS/BuildMonkey'
19 |
20 | plugins {
21 | p2Plugin {
22 | description = 'Deployed build artefacts as p2 repository'
23 | tags = ['eclipse', 'P2', 'repository']
24 | id = 'de.monkeyworks.buildmonkey.p2.P2DeployerPlugin'
25 | displayName = 'Build artefact as P2 deployer'
26 | }
27 | }
28 | mavenCoordinates {
29 | groupId = "de.monkeyworks.buildmonkey"
30 | }
31 | }
32 |
33 | publishPlugins.dependsOn(build)
--------------------------------------------------------------------------------
/repository/gradle.p2publish/src/main/groovy/de/monkeyworks/buildmonkey/p2/deployer/P2DeploymentExtension.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.p2.deployer
9 |
10 | import org.gradle.api.Project
11 |
12 | /**
13 | * Created by Johannes Tandler on 29.01.17.
14 | */
15 | class P2DeploymentExtension {
16 |
17 | // feature id
18 | String featureId = "platform.feature"
19 |
20 | // feature label
21 | String featureLabel = "My Feature"
22 |
23 | // feature version
24 | String version = "1.0.0"
25 |
26 | // target repository dir
27 | File targetRepository
28 |
29 | // project
30 | final Project project
31 |
32 | boolean generateFeature
33 |
34 | String qualifier
35 |
36 | boolean generateQualifier
37 |
38 | String sourceRepository
39 |
40 | // default constructor
41 | P2DeploymentExtension(Project project) {
42 | this.project = project
43 | targetRepository = new File(project.getBuildDir(), "p2-repo")
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/repository/gradle.p2publish/src/main/groovy/de/monkeyworks/buildmonkey/p2/deployer/util/FeatureHelper.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.p2.deployer.util
9 |
10 | import org.gradle.api.Project
11 | import org.gradle.api.tasks.bundling.Jar
12 |
13 | import java.util.zip.ZipEntry
14 | import java.util.zip.ZipOutputStream
15 |
16 | /**
17 | * Helper to create a eclipse feature.jar for all related projects
18 | *
19 | * Created by Johannes Tandler on 28.01.17.
20 | */
21 | class FeatureHelper {
22 |
23 | static void createFeatureXml(String featureId, String label, String version, String provider, boolean isSource, Set projects, OutputStream target) {
24 | Writer w = new OutputStreamWriter(target, 'UTF-8')
25 | createFeatureXml(featureId, label, version, provider, isSource, projects, w)
26 | }
27 |
28 | static void createFeatureXml(String featureId, String label, String version, String provider, boolean isSource, Set projects, Writer target) {
29 | def xml = new groovy.xml.MarkupBuilder(target)
30 | xml.setDoubleQuotes(true)
31 | xml.mkp.xmlDeclaration(version:'1.0', encoding: 'UTF-8')
32 |
33 | def classifier = ""
34 |
35 | if(isSource) {
36 | classifier = ".source"
37 | }
38 |
39 | def feature = featureId + classifier
40 |
41 | xml.feature(id: feature, label: label, version: version, 'provider-name': provider) {
42 | if(isSource) {
43 | includes(
44 | id: featureId,
45 | version: '0.0.0'
46 | )
47 | }
48 | for (Jar project : projects) {
49 | if(!project.baseName || project.baseName == "null") {
50 | continue
51 | }
52 | plugin(
53 | id: "${project.baseName}${classifier}",
54 | 'download-size': 0,
55 | 'install-size': 0,
56 | version: '0.0.0',
57 | unpack: false
58 | )
59 | }
60 | }
61 | }
62 |
63 | static void createJar(String featureId, String label, String version, String provider, boolean isSource, Set projects, File jarFile) {
64 | File target = jarFile
65 | target.parentFile.mkdirs()
66 |
67 | if(!target.exists())
68 | target.createNewFile()
69 |
70 | target.withOutputStream {
71 | ZipOutputStream zipStream = new ZipOutputStream(it)
72 | zipStream.putNextEntry(new ZipEntry('feature.xml'))
73 | createFeatureXml(featureId, label, version, provider, isSource, projects, zipStream)
74 | zipStream.closeEntry()
75 | zipStream.close()
76 | }
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/repository/gradle.p2publish/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.p2.P2DeployerPlugin.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 the original author or authors.
3 | # All rights reserved. This program and the accompanying materials
4 | # are made available under the terms of the Eclipse Public License v1.0
5 | # which accompanies this distribution, and is available at
6 | # http://www.eclipse.org/legal/epl-v10.html
7 | #
8 |
9 | implementation-class=de.monkeyworks.buildmonkey.p2.deployer.P2DeployerPlugin
10 |
--------------------------------------------------------------------------------
/repository/mavenArtefacts/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/repository/mavenArtefacts/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | mavenArtefacts
4 | Maven to OSGi converter.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 | org.eclipse.jdt.groovy.core.groovyNature
17 | org.eclipse.jdt.core.javanature
18 |
19 |
20 |
--------------------------------------------------------------------------------
/repository/mavenArtefacts/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | build.commands=org.eclipse.jdt.core.javabuilder
2 | connection.arguments=
3 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
4 | connection.java.home=null
5 | connection.jvm.arguments=
6 | connection.project.dir=../..
7 | containers=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/
8 | derived.resources=.gradle,build
9 | eclipse.preferences.version=1
10 | natures=org.eclipse.jdt.groovy.core.groovyNature,org.eclipse.jdt.core.javanature
11 | project.path=\:repository\:gradle.mavenize
12 |
--------------------------------------------------------------------------------
/repository/mavenArtefacts/.settings/org.eclipse.jdt.groovy.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | groovy.compiler.level=24
3 |
--------------------------------------------------------------------------------
/repository/mavenArtefacts/build.gradle:
--------------------------------------------------------------------------------
1 | repositories {
2 | jcenter()
3 | }
4 |
5 | dependencies {
6 | compile 'org.apache.maven:maven-ant-tasks:2.1.3'
7 | compile 'org.osgi:org.eclipse.osgi:3.10.100.v20150529-1857'
8 | compile 'de.monkeyworks.buildmonkey:base:1.0.4'
9 | }
10 |
11 | apply plugin: "com.gradle.plugin-publish"
12 |
13 | version = '0.4.8'
14 |
15 | pluginBundle {
16 | website = 'https://github.com/MONKEY-WORKS/BuildMonkey/wiki'
17 | vcsUrl = 'https://github.com/MONKEY-WORKS/BuildMonkey'
18 |
19 | plugins {
20 | mavenArtefactsPlugin {
21 | description = 'Converts a list of maven artefacts to OSGi bundles and puts them into a mirrored maven repository and new p2 reposiotry'
22 | tags = ['MAVEN', 'OSGi', 'P2']
23 | id = 'de.monkeyworks.buildmonkey.maven.MavenArtefactsPlugin'
24 | displayName = 'Maven to OSGi converter'
25 | }
26 | }
27 | mavenCoordinates {
28 | groupId = "de.monkeyworks.buildmonkey"
29 | }
30 | }
31 |
32 | publishPlugins.dependsOn(build)
33 |
--------------------------------------------------------------------------------
/repository/mavenArtefacts/src/main/groovy/de/monkeyworks/buildmonkey/mavenizer/MavenArtefactsExtension.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 the original author or authors.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License v1.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.eclipse.org/legal/epl-v10.html
7 | */
8 | package de.monkeyworks.buildmonkey.mavenizer
9 |
10 | import org.gradle.api.Project
11 |
12 | /**
13 | * Created by micha on 13.03.17.
14 | */
15 | class MavenArtefactsExtension {
16 | def artefacts = []
17 | def prefix
18 | def updateSiteDir
19 | def targetDir
20 | def uploadThreads
21 |
22 | def featureId
23 | def featureName
24 | def featureVersion
25 |
26 | def repositoryServerURL
27 | def repositoryUser
28 | def repositoryPassword
29 |
30 | def mavenRepositoryServerURL
31 | def mavenRepositoryName
32 | def mavenRepositoryUser
33 | def mavenRepositoryPassword
34 |
35 | def p2RepositoryServerURL
36 | def p2RepositoryName
37 | def p2RepositoryUser
38 | def p2RepositoryPassword
39 |
40 | private final Project project
41 |
42 | MavenArtefactsExtension(Project project) {
43 | this.project = project
44 |
45 | uploadThreads = '4'
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/repository/mavenArtefacts/src/main/resources/META-INF/gradle-plugins/de.monkeyworks.buildmonkey.maven.MavenArtefactsPlugin.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 the original author or authors.
3 | # All rights reserved. This program and the accompanying materials
4 | # are made available under the terms of the Eclipse Public License v1.0
5 | # which accompanies this distribution, and is available at
6 | # http://www.eclipse.org/legal/epl-v10.html
7 | #
8 |
9 | implementation-class=de.monkeyworks.buildmonkey.mavenizer.MavenArtefactsPlugin
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * This settings file was generated by the Gradle 'init' task.
3 | *
4 | * The settings file is used to specify which projects to include in your build.
5 | * In a single project build this file can be empty or even removed.
6 | *
7 | * Detailed information about configuring a multi-project build in Gradle can be found
8 | * in the user guide at https://docs.gradle.org/3.3/userguide/multi_project_builds.html
9 | */
10 |
11 | rootProject.name = 'BuildMonkey'
12 |
13 | include 'base'
14 |
15 | include 'artifactoryupload'
16 |
17 | def projectTreeRootDir = new File( "${rootProject.dir}" )
18 |
19 | // Shared components
20 |
21 | def sharedRootDir = new File( projectTreeRootDir, 'compilation' )
22 |
23 | include ':gradle.dependency'
24 | project( ':gradle.dependency' ).projectDir = new File( sharedRootDir, 'gradle.dependency' )
25 | include ':gradle.projectsetup'
26 | project( ':gradle.projectsetup' ).projectDir = new File( sharedRootDir, 'gradle.projectsetup' )
27 |
28 |
29 | sharedRootDir = new File( projectTreeRootDir, 'materialisation' )
30 |
31 | include ':gradle.pde'
32 | project( ':gradle.pde' ).projectDir = new File( sharedRootDir, 'gradle.pde' )
33 |
34 |
35 | sharedRootDir = new File( projectTreeRootDir, 'repository' )
36 |
37 | include ':mavenArtefacts'
38 | project( ':mavenArtefacts' ).projectDir = new File( sharedRootDir, 'mavenArtefacts' )
39 | include ':gradle.mavenize'
40 | project( ':gradle.mavenize' ).projectDir = new File( sharedRootDir, 'gradle.mavenize' )
41 | include ':gradle.p2'
42 | project( ':gradle.p2' ).projectDir = new File( sharedRootDir, 'gradle.p2' )
43 | include ':gradle.p2publish'
44 | project( ':gradle.p2publish' ).projectDir = new File( sharedRootDir, 'gradle.p2publish' )
45 | include 'osgi:manifestUpdater'
46 | findProject(':osgi:manifestUpdater')?.name = 'manifestUpdater'
47 |
48 |
--------------------------------------------------------------------------------