Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Runtimes with parameters #354

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions boost-common/src/main/java/boost/common/runtimes/RuntimeI.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@
*******************************************************************************/
package boost.common.runtimes;

import java.util.List;

import boost.common.BoostException;
import boost.common.boosters.AbstractBoosterConfig;

public abstract interface RuntimeI {
//Will need to pass in plugin mojo/task to Maven/Gradle along with project object

public void doPackage(List<AbstractBoosterConfig> boosterConfigs, Object project, Object pluginTask) throws BoostException;

public void doPackage() throws BoostException;

public void doDebug(boolean clean) throws BoostException;
public void doDebug(Object project, Object pluginTask) throws BoostException;

public void doRun(boolean clean) throws BoostException;
public void doRun(Object project, Object pluginTask) throws BoostException;

public void doStart(boolean clean, int verifyTimeout, int serverStartTimeout) throws BoostException;
public void doStart(Object project, Object pluginTask) throws BoostException;

public void doStop() throws BoostException;
public void doStop(Object project, Object pluginTask) throws BoostException;

}
28 changes: 10 additions & 18 deletions boost-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

archivesBaseName = 'boost-gradle-plugin'
group = 'io.openliberty.boost'
group = 'boost'
version = '0.1.1-SNAPSHOT'

def boosterVersion = '0.1.3-SNAPSHOT'
Expand All @@ -24,9 +24,9 @@ repositories {

dependencies {
compile localGroovy()
compile 'net.wasdev.wlp.gradle.plugins:liberty-gradle-plugin:2.6.6-SNAPSHOT'
compile 'net.wasdev.wlp.gradle.plugins:liberty-gradle-plugin:2.6.7-SNAPSHOT'
compile group: 'commons-io', name: 'commons-io', version: '2.6'
compile 'io.openliberty.boost:boost-common:0.1.3-SNAPSHOT'
compile 'boost:boost-common:0.1.3-SNAPSHOT'
compile 'com.spotify:docker-client:8.11.7'

testCompile 'junit:junit:4.12'
Expand All @@ -39,36 +39,28 @@ test {
doFirst { //Copying gradle.properties with plugin version to test projects
String runtimeGroup
String runtimeArtifactId
String libertyRuntime = System.getProperty('runtime')
String runtimeVersion = System.getProperty('runtimeVersion')
String runtime = System.getProperty('runtime')

if (libertyRuntime == null || libertyRuntime.isEmpty()) {
if (runtime == null || runtime.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exception explicitly states they need to specify a Liberty runtime. Should it be more generic? Same for the runtimeVersion check below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yup, I'll change these to be boost specific.

throw new GradleException('Tests could not be run. Please specify a Liberty runtime. Choose either wlp or ol.')
}
if (runtimeVersion == null || runtimeVersion.isEmpty()) {
throw new GradleException('Tests could not be run. Please specify a Liberty runtime version.')
}

Properties prop = new Properties()
OutputStream output = null

try {
output = new FileOutputStream("${buildDir}/gradle.properties")

if (libertyRuntime == "ol") {
runtimeGroup = "io.openliberty"
runtimeArtifactId = "openliberty-runtime"
} else {
runtimeGroup = "com.ibm.websphere.appserver.runtime"
runtimeArtifactId = "wlp-javaee7"
if (runtime == "ol") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do other runtimes get handled? Not understanding why we do something for "ol" specifically here.

runtimeGroup = "boost.runtimes"
runtimeArtifactId = "openliberty-gradle"
}

// set the properties value
prop.setProperty("boostVersion", version)
prop.setProperty("boosterVersion", boosterVersion)
prop.setProperty("runtimeGroup", runtimeGroup)
prop.setProperty("runtimeArtifactId", runtimeArtifactId)
prop.setProperty("runtimeVersion", runtimeVersion)

// save properties to project root folder
prop.store(output, null)
Expand Down Expand Up @@ -165,8 +157,8 @@ if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')
gradlePlugin {
plugins {
boostPlugin {
id = 'io.openliberty.boost'
implementationClass = 'io.openliberty.boost.gradle.Boost'
id = 'boost'
implementationClass = 'boost.gradle.Boost'
}
}
}
Binary file removed boost-gradle/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 0 additions & 5 deletions boost-gradle/gradle/wrapper/gradle-wrapper.properties

This file was deleted.

27 changes: 27 additions & 0 deletions boost-gradle/openliberty-gradle/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apply plugin: 'java'
apply plugin: 'maven'

repositories {
mavenLocal()
mavenCentral()
}

dependencies {
compile "boost:boost-common:0.1.3-SNAPSHOT"
compile "boost.runtimes:liberty-common:0.1-SNAPSHOT"
compile "boost:boost-gradle-plugin:0.1.1-SNAPSHOT"
compile 'net.wasdev.wlp.gradle.plugins:liberty-gradle-plugin:2.6.6-SNAPSHOT'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed we used 2.6.7-SNAPSHOT above.

compile "commons-io:commons-io:2.6"
compile localGroovy()
compile gradleApi()
}

group = 'boost.runtimes'
archivesBaseName = 'openliberty-gradle'
version = '0.1.3-SNAPSHOT'

jar {
from ('./src/main/resources') {
include 'META-INF/services/boost.common.runtimes.GradleRuntimeI'
}
}
Loading