Search in sources :

Example 1 with LiferayGradleProject

use of com.liferay.ide.gradle.core.LiferayGradleProject in project liferay-ide by liferay.

the class GradleProjectTests method getSymbolicName.

@Test
public void getSymbolicName() throws Exception {
    LiferayGradleProject gradleProject = Util.fullImportGradleProject("projects/getSymbolicName");
    assertNotNull(gradleProject);
    NullProgressMonitor monitor = new NullProgressMonitor();
    IPath outputJar = gradleProject.getOutputBundle(false, monitor);
    if (outputJar != null && outputJar.toFile().exists()) {
        outputJar = gradleProject.getOutputBundle(true, monitor);
    }
    assertTrue(outputJar.toFile().exists());
    assertEquals("com.liferay.test.bsn", gradleProject.getSymbolicName());
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) LiferayGradleProject(com.liferay.ide.gradle.core.LiferayGradleProject) IPath(org.eclipse.core.runtime.IPath) Test(org.junit.Test)

Example 2 with LiferayGradleProject

use of com.liferay.ide.gradle.core.LiferayGradleProject in project liferay-ide by liferay.

the class GradleProjectTests method toolingApiCustomModel.

@Test
public void toolingApiCustomModel() throws Exception {
    LiferayGradleProject gradleProject = Util.fullImportGradleProject("projects/customModel");
    assertNotNull(gradleProject);
    CustomModel customModel = GradleCore.getToolingModel(CustomModel.class, gradleProject.getProject());
    assertNotNull(customModel);
    assertFalse(customModel.hasPlugin("not.a.plugin"));
    assertTrue(customModel.hasPlugin("org.dm.gradle.plugins.bundle.BundlePlugin"));
}
Also used : LiferayGradleProject(com.liferay.ide.gradle.core.LiferayGradleProject) CustomModel(com.liferay.blade.gradle.model.CustomModel) Test(org.junit.Test)

Example 3 with LiferayGradleProject

use of com.liferay.ide.gradle.core.LiferayGradleProject in project liferay-ide by liferay.

the class ImportWorkspaceProjectTests method testImportLiferayWorkspaceEE.

@Test
public void testImportLiferayWorkspaceEE() throws Exception {
    LiferayGradleProject eeProject = Util.fullImportGradleProject("projects/liferay-workspace-ee");
    assertNotNull(eeProject);
    Util.waitForBuildAndValidation();
    assertNotLiferayProject("liferay-workspace-ee");
    assertNotLiferayProject("aws");
    assertNotLiferayProject("docker");
    assertNotLiferayProject("jenkins");
}
Also used : LiferayGradleProject(com.liferay.ide.gradle.core.LiferayGradleProject) Test(org.junit.Test)

Example 4 with LiferayGradleProject

use of com.liferay.ide.gradle.core.LiferayGradleProject in project liferay-ide by liferay.

the class ImportWorkspaceProjectTests method testImportLiferayWorkspace.

@Test
public void testImportLiferayWorkspace() throws Exception {
    LiferayGradleProject rootProject = Util.fullImportGradleProject("projects/testWorkspace");
    assertNotNull(rootProject);
    Util.waitForBuildAndValidation();
    assertLiferayProject("jstl.test");
    assertLiferayProject("roster-api");
    assertLiferayProject("roster-service");
    assertLiferayProject("roster-web");
    assertLiferayProject("sample-portlet");
    assertLiferayProject("sample-model-listener");
    assertLiferayProject("sample-theme");
    assertSourceFolders("sample-theme", "src");
}
Also used : LiferayGradleProject(com.liferay.ide.gradle.core.LiferayGradleProject) Test(org.junit.Test)

Example 5 with LiferayGradleProject

use of com.liferay.ide.gradle.core.LiferayGradleProject in project liferay-ide by liferay.

the class Util method fullImportGradleProject.

public static LiferayGradleProject fullImportGradleProject(String projectPath) throws Exception {
    IWorkspace ws = ResourcesPlugin.getWorkspace();
    IWorkspaceRoot root = ws.getRoot();
    File src = new File(projectPath);
    File dst = new File(root.getLocation().toFile(), src.getName());
    TestUtil.copyDir(src, dst);
    IProgressMonitor monitor = new NullProgressMonitor();
    IStatus status = GradleUtil.importGradleProject(dst, monitor);
    Util.waitForBuildAndValidation();
    if (status.isOK()) {
        IProject project = CoreUtil.getProject(dst.getName());
        return new LiferayGradleProject(project);
    } else {
        throw new Exception(status.getException());
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IStatus(org.eclipse.core.runtime.IStatus) LiferayGradleProject(com.liferay.ide.gradle.core.LiferayGradleProject) IWorkspaceRoot(org.eclipse.core.resources.IWorkspaceRoot) IWorkspace(org.eclipse.core.resources.IWorkspace) File(java.io.File) IProject(org.eclipse.core.resources.IProject) OperationCanceledException(org.eclipse.core.runtime.OperationCanceledException)

Aggregations

LiferayGradleProject (com.liferay.ide.gradle.core.LiferayGradleProject)8 Test (org.junit.Test)7 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)3 IProject (org.eclipse.core.resources.IProject)2 IPath (org.eclipse.core.runtime.IPath)2 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 CustomModel (com.liferay.blade.gradle.model.CustomModel)1 IBundleProject (com.liferay.ide.core.IBundleProject)1 GradleDependency (com.liferay.ide.gradle.core.parser.GradleDependency)1 GradleDependencyUpdater (com.liferay.ide.gradle.core.parser.GradleDependencyUpdater)1 IProjectBuilder (com.liferay.ide.project.core.IProjectBuilder)1 File (java.io.File)1 IFile (org.eclipse.core.resources.IFile)1 IWorkspace (org.eclipse.core.resources.IWorkspace)1 IWorkspaceRoot (org.eclipse.core.resources.IWorkspaceRoot)1 WorkspaceJob (org.eclipse.core.resources.WorkspaceJob)1 IStatus (org.eclipse.core.runtime.IStatus)1 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)1