diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index bd850832b0..61a7576d76 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -55,17 +55,4 @@ jobs: - name: Run tests shell: bash run: | - ./run-tests.sh - - name: Upload tests - uses: actions/upload-artifact@v1 - if: ${{ failure() }} - with: - name: surefire-reports.tar.gz - path: surefire-reports.tar.gz - - name: Run reporter - uses: check-run-reporter/action@v2.11.2 - if: ${{ always() }} - with: - label: "Maven surefire test reports" - report: "**/TEST-*.xml" - token: "000f9d8e-4211-4cb7-9438-cb165d0db32a" + ./run-tests.sh \ No newline at end of file diff --git a/build/parent/pom.xml b/build/parent/pom.xml index c214077ba1..d26e7e4560 100644 --- a/build/parent/pom.xml +++ b/build/parent/pom.xml @@ -27,8 +27,8 @@ Liferay IDE Parent - https://repository.liferay.com/nexus/content/repositories/liferay-public-snapshots/com/liferay/blade/com.liferay.blade.cli/4.1.2-SNAPSHOT/com.liferay.blade.cli-4.1.2-20230425.080220-14.jar - 209251e2e308ea119def0941e1d78b1c + https://repository-cdn.liferay.com/nexus/content/repositories/liferay-public-snapshots/com/liferay/blade/com.liferay.blade.cli/5.0.1-SNAPSHOT/com.liferay.blade.cli-5.0.1-20230927.053520-3.jar + 73f74298226c1b1e818969fd064101d2 https://repository.liferay.com/nexus/content/repositories/public/com/liferay/blade/com.liferay.blade.cli/3.9.2/com.liferay.blade.cli-3.9.2.jar 08aedcb6bacc3166060d0032f9489dd1 https://us-east-1.linodeobjects.com/devtools-s3.liferay.com/liferay-ide-files/docs/code-upgrade-docs-20210312.zip diff --git a/tools/plugins/com.liferay.ide.gradle.core/.classpath b/tools/plugins/com.liferay.ide.gradle.core/.classpath index f6802cd653..0d494e100d 100644 --- a/tools/plugins/com.liferay.ide.gradle.core/.classpath +++ b/tools/plugins/com.liferay.ide.gradle.core/.classpath @@ -4,6 +4,6 @@ - + diff --git a/tools/plugins/com.liferay.ide.project.core/META-INF/MANIFEST.MF b/tools/plugins/com.liferay.ide.project.core/META-INF/MANIFEST.MF index 676f7c32f4..39780087b5 100644 --- a/tools/plugins/com.liferay.ide.project.core/META-INF/MANIFEST.MF +++ b/tools/plugins/com.liferay.ide.project.core/META-INF/MANIFEST.MF @@ -15,6 +15,7 @@ Require-Bundle: biz.aQute.bndlib;bundle-version="[5,6)", org.apache.commons.lang, org.eclipse.core.commands, org.eclipse.core.expressions, + org.eclipse.core.net, org.eclipse.core.resources, org.eclipse.core.runtime, org.eclipse.emf.ecore, diff --git a/tools/plugins/com.liferay.ide.project.core/src/com/liferay/ide/project/core/modules/BladeCLI.java b/tools/plugins/com.liferay.ide.project.core/src/com/liferay/ide/project/core/modules/BladeCLI.java index 53e08e218c..a05d92f7a0 100644 --- a/tools/plugins/com.liferay.ide.project.core/src/com/liferay/ide/project/core/modules/BladeCLI.java +++ b/tools/plugins/com.liferay.ide.project.core/src/com/liferay/ide/project/core/modules/BladeCLI.java @@ -15,8 +15,10 @@ package com.liferay.ide.project.core.modules; import com.liferay.ide.core.IWorkspaceProject; +import com.liferay.ide.core.LiferayCore; import com.liferay.ide.core.StringBufferOutputStream; import com.liferay.ide.core.util.FileUtil; +import com.liferay.ide.core.util.StringUtil; import com.liferay.ide.core.workspace.LiferayWorkspaceUtil; import com.liferay.ide.project.core.ProjectCore; @@ -24,6 +26,8 @@ import java.io.IOException; import java.io.PrintStream; +import java.net.URL; + import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -32,7 +36,10 @@ import org.apache.tools.ant.DefaultLogger; import org.apache.tools.ant.Project; import org.apache.tools.ant.taskdefs.Java; +import org.apache.tools.ant.types.Environment; +import org.eclipse.core.net.proxy.IProxyData; +import org.eclipse.core.net.proxy.IProxyService; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; @@ -174,6 +181,65 @@ private static String[] _execute(IPath bladeCLIPath, String args) throws BladeCL javaTask.setJar(bladeCLIPath.toFile()); javaTask.setArgs(args); + try { + IProxyService proxyService = LiferayCore.getProxyService(); + + URL downloadProductInfoUrl = new URL(_PRODUCT_INFO_URL); + + IProxyData[] proxyDatas = proxyService.select(downloadProductInfoUrl.toURI()); + + for (IProxyData proxyData : proxyDatas) { + if (Objects.isNull(proxyData)) { + continue; + } + + if (Objects.isNull(proxyData.getHost())) { + continue; + } + + String proxyType = StringUtil.toLowerCase(proxyData.getType()); + + Environment.Variable proxyHostVariable = new Environment.Variable(); + + proxyHostVariable.setKey(proxyType + ".proxyHost"); + proxyHostVariable.setValue(proxyData.getHost()); + + javaTask.addSysproperty(proxyHostVariable); + + Environment.Variable proxyPortVariable = new Environment.Variable(); + + proxyPortVariable.setKey(proxyType + ".proxyPort"); + proxyPortVariable.setValue(String.valueOf(proxyData.getPort())); + + javaTask.addSysproperty(proxyPortVariable); + + if (!proxyData.isRequiresAuthentication()) { + continue; + } + + if (Objects.isNull(proxyData.getUserId()) || Objects.isNull(proxyData.getPassword())) { + continue; + } + + Environment.Variable proxyUserVariable = new Environment.Variable(); + + proxyUserVariable.setKey(proxyType + ".proxyUser"); + proxyUserVariable.setValue(proxyData.getUserId()); + + javaTask.addSysproperty(proxyUserVariable); + + Environment.Variable proxyPasswordVariable = new Environment.Variable(); + + proxyPasswordVariable.setKey(proxyType + ".proxyPassword"); + proxyPasswordVariable.setValue(proxyData.getPassword()); + + javaTask.addSysproperty(proxyPasswordVariable); + } + } + catch (Exception exception) { + throw new BladeCLIException(exception.getMessage()); + } + DefaultLogger logger = new DefaultLogger(); project.addBuildListener(logger); @@ -233,6 +299,8 @@ private static IPath _getBladeJarFromBundle(String jarName) throws IOException { return new Path(bladeJarBundleFile.getCanonicalPath()); } + private static final String _PRODUCT_INFO_URL = "https://releases.liferay.com/tools/workspace/.product_info.json"; + private static String _bladeJarName = null; } \ No newline at end of file diff --git a/tools/tests/com.liferay.ide.project.core.tests/src/com/liferay/ide/project/core/modules/BladeCLITests.java b/tools/tests/com.liferay.ide.project.core.tests/src/com/liferay/ide/project/core/modules/BladeCLITests.java index 752eb21cf0..c98549bcec 100644 --- a/tools/tests/com.liferay.ide.project.core.tests/src/com/liferay/ide/project/core/modules/BladeCLITests.java +++ b/tools/tests/com.liferay.ide.project.core.tests/src/com/liferay/ide/project/core/modules/BladeCLITests.java @@ -49,9 +49,9 @@ public void testBundleFileIsValid() throws Exception Domain domain = Domain.domain( bladeFile ); - assertTrue( domain.getBundleVersion().startsWith( "4" ) ); + assertTrue( domain.getBundleVersion().startsWith( "5" ) ); - assertFalse( domain.getBundleVersion().startsWith( "3" ) ); + assertFalse( domain.getBundleVersion().startsWith( "4" ) ); } @Test diff --git a/tools/tests/com.liferay.ide.project.core.tests/src/com/liferay/ide/project/core/tests/modules/NewLiferayComponentOpTests.java b/tools/tests/com.liferay.ide.project.core.tests/src/com/liferay/ide/project/core/tests/modules/NewLiferayComponentOpTests.java index 86ca3559b9..27bed38d11 100644 --- a/tools/tests/com.liferay.ide.project.core.tests/src/com/liferay/ide/project/core/tests/modules/NewLiferayComponentOpTests.java +++ b/tools/tests/com.liferay.ide.project.core.tests/src/com/liferay/ide/project/core/tests/modules/NewLiferayComponentOpTests.java @@ -21,7 +21,6 @@ import com.liferay.ide.core.tests.TestUtil; import com.liferay.ide.core.util.CoreUtil; import com.liferay.ide.core.util.FileUtil; -import com.liferay.ide.core.workspace.LiferayWorkspaceUtil; import com.liferay.ide.project.core.modules.NewLiferayComponentOp; import com.liferay.ide.project.core.modules.NewLiferayComponentOpMethods; import com.liferay.ide.project.core.modules.NewLiferayModuleProjectOp;