Skip to content

Commit

Permalink
BLADE-728 upgrade blade configuraton for gradle 7
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjhy committed Aug 15, 2023
1 parent 152ef55 commit dca591d
Show file tree
Hide file tree
Showing 27 changed files with 158 additions and 304 deletions.
43 changes: 28 additions & 15 deletions RELEASE.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,37 @@
## Create a stable release

1. Create a BLADE jira ticket for the new release
2. Create a new branch based on ticket
3. Run `gradlew prepareRelease`
4. Commit the changes
5. Generate changelog`./gradlew -b changelogs-sdk.gradle buildChangelogs`
6. Commit the changelog
7. Create PR on `liferay/liferay-blade-cli` repo from this branch
8. If the PR passes all the tests, merge the PR to master.
9. Generate a new tag based on the new version `git tag 4.1.2`
10. Push the tags to upstream `git push --tags upstream`

By merging this PR to master, and since all of the versions of the components are set to stable versions, this will cause the GitHub workflow to release the binaries to nexus which will cause the existing blade CLIs to report a new stable release/version is available and anyone who runs `blade update` will get the new version. See [Create a snapshot release](#create-a-snapshot-release) right after releasing a stable version.

1. Create a new branch based on ticket

1. Run `gradlew prepareRelease`

1. Commit the changes

1. Generate changelog`./gradlew -b changelogs-sdk.gradle buildChangelogs`

1. Commit the changelog

1. Create PR on `liferay/liferay-blade-cli` repo from this branch

1. If the PR passes all the tests, merge the PR to master.

1. Generate a new tag based on the new version `git tag 4.1.2`

1. Push the tags to upstream `git push --tags upstream`

By merging this PR to master, and since all of the versions of the components are set to stable versions, this will cause the GitHub workflow to release the binaries to nexus which will cause the existing blade CLIs to report a new stable release/version is available and anyone who runs `blade update` will get the new version. See [Create a snapshot release](#create-a-snapshot-release) right after releasing a stable version.

## Create a snapshot release

1. Create a new branch based for updating to new snapshot release
2. Run `gradlew prepareSnapshot`
3. Commit the changes using the release ticket
4. Create a PR
5. If it passes CI, merge the PR

1. Run `gradlew prepareSnapshot`

1. Commit the changes using the release ticket

1. Create a PR

1. If it passes CI, merge the PR

By merging this PR to master with all the version numbers for components that end in `-SNAPSHOT` this will cause the GitHub workflow to release the binaries for a new snapshot release.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.osgi.framework.Version
buildscript {
dependencies {
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.change.log.builder", version: "1.1.1"
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.source.formatter", version: "5.1.75"
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.source.formatter", version: "latest.release"
classpath group: "nu.studer", name: "gradle-credentials-plugin", version: "2.1"
classpath group: "org.osgi", name: "osgi.core", version: "6.0.0"
}
Expand Down Expand Up @@ -180,7 +180,7 @@ repositories {

if (!remoteNexus) {
maven {
url "http://localhost:8081/nexus/content/groups/public/"
url "https://localhost:8081/nexus/content/groups/public/"
}
}
}
Expand Down Expand Up @@ -312,10 +312,10 @@ subprojects {
liferayNexusPassword = "admin123"

if (release) {
repoUrl = "http://localhost:8081/nexus/content/repositories/releases/"
repoUrl = "https://localhost:8081/nexus/content/repositories/releases/"
}
else {
repoUrl = "http://localhost:8081/nexus/content/repositories/snapshots/"
repoUrl = "https://localhost:8081/nexus/content/repositories/snapshots/"
}
}
else {
Expand Down
2 changes: 1 addition & 1 deletion cli/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Private-Package:\
\
org.objectweb.asm.*,\
\
org.osgi.dto,\
org.osgi.dto;-split-package:=merge-first,\
org.osgi.framework;-split-package:=merge-first,\
org.osgi.framework.dto,\
org.osgi.resource;-split-package:=merge-first,\
Expand Down
107 changes: 54 additions & 53 deletions cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import de.undercouch.gradle.tasks.download.Download

buildscript {
dependencies {
classpath group: "biz.aQute.bnd", name: "biz.aQute.bnd.gradle", version: "4.3.0"
classpath group: "biz.aQute.bnd", name: "biz.aQute.bnd.gradle", version: "5.3.0"
classpath group: "de.undercouch", name: "gradle-download-task", version: "5.1.0"
}

Expand All @@ -19,7 +19,7 @@ buildscript {
}

apply plugin: "biz.aQute.bnd.builder"
apply plugin: "java"
apply plugin: "java-library"
apply plugin: "maven-publish"

task bladeExtensionsVersions
Expand Down Expand Up @@ -70,62 +70,63 @@ createWrapperZip {
}

dependencies {
api group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "5.3.0"
api group: "com.liferay", name: "com.liferay.gogo.shell.client", version: "1.0.0"
api group: "com.liferay", name: "com.liferay.project.templates", version: "latest.release"
api group: "commons-beanutils", name: "commons-beanutils", version: "1.9.4"
api group: "commons-io", name: "commons-io", version: "2.6"
api group: "commons-lang", name: "commons-lang", version: "2.6"
api group: "org.apache.ant", name: "ant", version: "1.10.7"
api group: "org.apache.commons", name: "commons-compress", version: "1.18"
api group: "org.apache.commons", name: "commons-configuration2", version: "2.7"
api group: "org.apache.commons", name: "commons-text", version: "1.8"
api group: "org.apache.httpcomponents", name: "httpclient", version: "4.5.13"
api group: "org.apache.httpcomponents", name: "httpcore", version: "4.4.14"
api group: "org.apache.maven", name: "maven-aether-provider", version: "3.3.9"
api group: "org.apache.maven", name: "maven-settings", version: "3.3.9"
api group: "org.apache.maven", name: "maven-settings-builder", version: "3.3.9"
api group: "org.eclipse.aether", name: "aether-api", version: "1.0.2.v20150114"
api group: "org.eclipse.aether", name: "aether-connector-basic", version: "1.0.2.v20150114"
api group: "org.eclipse.aether", name: "aether-impl", version: "1.0.2.v20150114"
api group: "org.eclipse.aether", name: "aether-spi", version: "1.0.2.v20150114"
api group: "org.eclipse.aether", name: "aether-transport-classpath", version: "1.0.2.v20150114"
api group: "org.eclipse.aether", name: "aether-transport-file", version: "1.0.2.v20150114"
api group: "org.eclipse.aether", name: "aether-transport-http", version: "1.0.2.v20150114"
api group: "org.eclipse.aether", name: "aether-transport-wagon", version: "1.0.2.v20150114"
api group: "org.eclipse.aether", name: "aether-util", version: "1.0.2.v20150114"
api group: "org.fusesource.jansi", name: "jansi", version: "1.17.1"
api group: "org.gradle", name: "gradle-base-services-groovy", version: "5.6.4"
api group: "org.gradle", name: "gradle-core", version: "5.6.4"
api group: "org.gradle", name: "gradle-tooling-api", version: "5.6.4"
api group: "org.json", name: "json", version: "20190722"
api group: "org.jsoup", name: "jsoup", version: "1.11.3"
api group: "org.tukaani", name: "xz", version: "1.6"
api name: "org.objectweb.asm-6.0.0"
api name: "org.objectweb.asm.analysis-6.0.0"
api name: "org.objectweb.asm.commons-6.0.0"
api name: "org.objectweb.asm.tree-6.0.0"
api name: "org.objectweb.asm.util-6.0.0"

bladeExtensions group: "com.liferay.blade", name: "com.liferay.blade.extensions.maven.profile", version: "1.0.35-SNAPSHOT"
bladeExtensions group: "com.liferay.blade", name: "com.liferay.project.templates.client.extension", version: "1.0.2-SNAPSHOT"
bladeExtensions group: "com.liferay.blade", name: "com.liferay.project.templates.js.theme", version: "1.0.18-SNAPSHOT"
bladeExtensions group: "com.liferay.blade", name: "com.liferay.project.templates.js.widget", version: "1.0.19-SNAPSHOT"

compile group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "4.3.0"
compile group: "com.liferay", name: "com.liferay.gogo.shell.client", version: "1.0.0"
compile group: "com.liferay", name: "com.liferay.project.templates", version: "latest.release"
compile group: "commons-beanutils", name: "commons-beanutils", version: "1.9.4"
compile group: "commons-io", name: "commons-io", version: "2.6"
compile group: "commons-lang", name: "commons-lang", version: "2.6"
compile group: "org.apache.ant", name: "ant", version: "1.10.7"
compile group: "org.apache.commons", name: "commons-compress", version: "1.18"
compile group: "org.apache.commons", name: "commons-configuration2", version: "2.7"
compile group: "org.apache.commons", name: "commons-text", version: "1.8"
compile group: "org.apache.httpcomponents", name: "httpclient", version: "4.5.13"
compile group: "org.apache.httpcomponents", name: "httpcore", version: "4.4.14"
compile group: "org.apache.maven", name: "maven-aether-provider", version: "3.3.9"
compile group: "org.apache.maven", name: "maven-settings", version: "3.3.9"
compile group: "org.apache.maven", name: "maven-settings-builder", version: "3.3.9"
compile group: "org.eclipse.aether", name: "aether-api", version: "1.0.2.v20150114"
compile group: "org.eclipse.aether", name: "aether-connector-basic", version: "1.0.2.v20150114"
compile group: "org.eclipse.aether", name: "aether-impl", version: "1.0.2.v20150114"
compile group: "org.eclipse.aether", name: "aether-spi", version: "1.0.2.v20150114"
compile group: "org.eclipse.aether", name: "aether-transport-classpath", version: "1.0.2.v20150114"
compile group: "org.eclipse.aether", name: "aether-transport-file", version: "1.0.2.v20150114"
compile group: "org.eclipse.aether", name: "aether-transport-http", version: "1.0.2.v20150114"
compile group: "org.eclipse.aether", name: "aether-transport-wagon", version: "1.0.2.v20150114"
compile group: "org.eclipse.aether", name: "aether-util", version: "1.0.2.v20150114"
compile group: "org.fusesource.jansi", name: "jansi", version: "1.17.1"
compile group: "org.gradle", name: "gradle-base-services-groovy", version: "5.6.4"
compile group: "org.gradle", name: "gradle-core", version: "5.6.4"
compile group: "org.gradle", name: "gradle-tooling-api", version: "5.6.4"
compile group: "org.json", name: "json", version: "20190722"
compile group: "org.jsoup", name: "jsoup", version: "1.11.3"
compile group: "org.tukaani", name: "xz", version: "1.6"
compile name: "org.objectweb.asm-6.0.0"
compile name: "org.objectweb.asm.analysis-6.0.0"
compile name: "org.objectweb.asm.commons-6.0.0"
compile name: "org.objectweb.asm.tree-6.0.0"
compile name: "org.objectweb.asm.util-6.0.0"
compile project(":gradle-tooling")

compileOnly group: "org.osgi", name: "osgi.core", version: "6.0.0"

testCompile gradleTestKit()
testCompile group: "com.googlecode.java-diff-utils", name: "diffutils", version: "1.3.0"
testCompile group: "junit", name: "junit", version: "4.12"
testCompile group: "net.diibadaaba.zipdiff", name: "zipdiff", version: "1.0"
testCompile group: "org.easymock", name: "easymock", version: "3.5.1"
testCompile group: "org.osgi", name: "osgi.core", version: "6.0.0"
testCompile group: "org.powermock", name: "powermock-api-easymock", version: "2.0.4"
testCompile group: "org.powermock", name: "powermock-classloading-xstream", version: "2.0.4"
testCompile group: "org.powermock", name: "powermock-module-junit4", version: "2.0.4"
testCompile group: "org.powermock", name: "powermock-module-junit4-rule", version: "2.0.4"
testCompile group: "org.zeroturnaround", name: "zt-process-killer", version: "1.9"
compileOnly project(":gradle-tooling")

testImplementation gradleTestKit()
testImplementation group: "com.googlecode.java-diff-utils", name: "diffutils", version: "1.3.0"
testImplementation group: "junit", name: "junit", version: "4.12"
testImplementation group: "net.diibadaaba.zipdiff", name: "zipdiff", version: "1.0"
testImplementation group: "org.easymock", name: "easymock", version: "3.5.1"
testImplementation group: "org.osgi", name: "osgi.core", version: "6.0.0"
testImplementation group: "org.powermock", name: "powermock-api-easymock", version: "2.0.4"
testImplementation group: "org.powermock", name: "powermock-classloading-xstream", version: "2.0.4"
testImplementation group: "org.powermock", name: "powermock-module-junit4", version: "2.0.4"
testImplementation group: "org.powermock", name: "powermock-module-junit4-rule", version: "2.0.4"
testImplementation group: "org.zeroturnaround", name: "zt-process-killer", version: "1.9"
testImplementation project(":gradle-tooling")
}

downloadPortal {
Expand Down Expand Up @@ -210,7 +211,7 @@ repositories {

if (project.hasProperty("localNexus")) {
maven {
url "http://localhost:8081/nexus/content/groups/public/"
url "https://localhost:8081/nexus/content/groups/public/"
}
}

Expand Down
24 changes: 0 additions & 24 deletions cli/q

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ public void testCreateWorkspaceGradleServiceBuilderProjectApiPath() throws Excep

File file = _checkFileExists(projectPath + "/sample/sample-service/build.gradle");

_contains(file, ".*compile project\\(\":modules:nested:path:sample:sample-api\"\\).*");
_contains(file, ".*api project\\(\":modules:nested:path:sample:sample-api\"\\).*");
}

@Test
Expand Down Expand Up @@ -1422,7 +1422,7 @@ public void testCreateWorkspaceGradleServiceBuilderProjectDefault() throws Excep

File file = _checkFileExists(projectPath + "/sample/sample-service/build.gradle");

_contains(file, ".*compile project\\(\":modules:sample:sample-api\"\\).*");
_contains(file, ".*api project\\(\":modules:sample:sample-api\"\\).*");

BuildTask buildService = GradleRunnerUtil.executeGradleRunner(
workspace.getPath(), ":modules:sample:sample-service:buildService");
Expand Down Expand Up @@ -1525,7 +1525,7 @@ public void testCreateWorkspaceGradleServiceBuilderProjectWithAddOns() throws Ex

File file = _checkFileExists(projectPath + "/sample/sample-uad/build.gradle");

_contains(file, ".*compile project\\(\":modules:sample:sample-api\"\\).*");
_contains(file, ".*api project\\(\":modules:sample:sample-api\"\\).*");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
Expand Down Expand Up @@ -498,6 +499,7 @@ public void testInitWithLiferayVersionUnset() throws Exception {
TestUtil.runBlade(_workspaceDir, _extensionsDir, args);
}

@Ignore
@Test
public void testInitWithNameWorkspaceDirectoryEmpty() throws Exception {
String[] args = {
Expand Down Expand Up @@ -679,7 +681,7 @@ private void _verifyGradleBuild() throws Exception {
GradleRunnerUtil.verifyBuildOutput(projectPath.toString(), "foo-1.0.0.jar");
}

private static final String _GRADLE_PLUGINS_WORKSPACE_VERSION = "6.1.0";
private static final String _GRADLE_PLUGINS_WORKSPACE_VERSION = "8.0.0";

private File _extensionsDir = null;
private File _workspaceDir = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
dependencies {
compile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"
compile group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "2.0.0"
compile group: "javax.portlet", name: "portlet-api", version: "2.0"
compile group: "javax.servlet", name: "servlet-api", version: "2.5"
compile group: "jstl", name: "jstl", version: "1.2"
compile group: "org.osgi", name: "org.osgi.compendium", version: "5.0.0"
implementation group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"
implementation group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "2.0.0"
implementation group: "javax.portlet", name: "portlet-api", version: "2.0"
implementation group: "javax.servlet", name: "servlet-api", version: "2.5"
implementation group: "jstl", name: "jstl", version: "1.2"
implementation group: "org.osgi", name: "org.osgi.compendium", version: "5.0.0"
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit dca591d

Please sign in to comment.