Skip to content

Commit

Permalink
Merge pull request #29 from jGauravGupta/FISH-7932
Browse files Browse the repository at this point in the history
FISH-7932 Release Payara Community Tools v1.8.0 with Cloud integration
  • Loading branch information
jGauravGupta authored Jul 19, 2024
2 parents aba2e66 + a4eea63 commit edfe83f
Show file tree
Hide file tree
Showing 32 changed files with 2,359 additions and 188 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Payara Micro Community Tools for IntelliJ IDEA Community Edition
# Payara IntelliJ Community Tools for IntelliJ IDEA Community Edition

[![License](https://img.shields.io/badge/License-EPL%202.0-red.svg)](http://www.eclipse.org/legal/epl-2.0)

### Ecosystem Plugin Support
Support for the Payara Micro Community Tools plugin is handled in the [Ecosystem Support Repository](https://github.com/payara/ecosystem-support)
Support for the Payara IntelliJ Community Tools plugin is handled in the [Ecosystem Support Repository](https://github.com/payara/ecosystem-support)

### IntelliJ IDEA Payara Plugin Documentation
Full documentation for the configuration and usage of the Payara Micro Community Tools plugin can be found in the [technical documentation](https://docs.payara.fish/community/docs/Technical%20Documentation/Ecosystem/IDE%20Integration/IntelliJ%20Plugin/Overview.html)
Full documentation for the configuration and usage of the Payara IntelliJ Community Tools plugin can be found in the [technical documentation](https://docs.payara.fish/community/docs/Technical%20Documentation/Ecosystem/IDE%20Integration/IntelliJ%20Plugin/Overview.html)
11 changes: 9 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,30 @@ apply plugin: 'idea'
apply plugin: 'java'

group 'fish.payara.micro.intellij'
version '1.8.0-SNAPSHOT'
version '1.9.0-SNAPSHOT'

sourceCompatibility = "17"
targetCompatibility = "17"

repositories {
mavenLocal()
mavenCentral()
maven {
url "https://nexus.dev.payara.fish/repository/payara-artifacts/"
}
}

dependencies {

implementation 'fish.payara.tools:payara-cloud:1.0-Alpha4'
implementation 'fish.payara.cloud:cloud-api:1.0.1'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.9.1'
}

intellij {
version = '241.14494.240'
type = 'IC'
pluginName = 'Payara Micro'
pluginName = 'Payara IntelliJ Community Tools'
plugins = ['java', 'maven', 'maven-model', 'gradle', 'terminal']
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/fish/payara/PayaraConstants.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 Payara Foundation and/or its affiliates and others.
* Copyright (c) 2020-2024 Payara Foundation and/or its affiliates and others.
* All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand All @@ -22,6 +22,7 @@
public interface PayaraConstants {

Icon PAYARA_ICON = IconLoader.getIcon("/icons/payara.svg");
Icon CLOUD_ICON = IconLoader.getIcon("/icons/cloud.svg");
int DEFAULT_DEBUG_PORT = 9007;

}
57 changes: 57 additions & 0 deletions src/main/java/fish/payara/cloud/PayaraCloudConfigurationType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright (c) 2020-2024 Payara Foundation and/or its affiliates and others.
* All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package fish.payara.cloud;

import fish.payara.cloud.maven.CloudMavenConfigurationFactory;
import com.intellij.execution.configurations.ConfigurationFactory;
import com.intellij.execution.configurations.ConfigurationType;
import static fish.payara.PayaraConstants.CLOUD_ICON;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;

public class PayaraCloudConfigurationType implements ConfigurationType {

@NotNull
@Override
public String getDisplayName() {
return "Payara Cloud";
}

@Override
public String getConfigurationTypeDescription() {
return "Payara Cloud configuration type";
}

@Override
public Icon getIcon() {
return CLOUD_ICON;
}

@NotNull
@Override
public String getId() {
return "PAYARA_CLOUD_CONFIGURATION";
}

@Override
public ConfigurationFactory[] getConfigurationFactories() {
return new ConfigurationFactory[]{
new CloudMavenConfigurationFactory(this)
};
}
}
188 changes: 188 additions & 0 deletions src/main/java/fish/payara/cloud/PayaraCloudProject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
/*
* Copyright (c) 2020-2022 Payara Foundation and/or its affiliates and others.
* All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package fish.payara.cloud;

import com.intellij.openapi.extensions.ExtensionsArea;
import com.intellij.openapi.extensions.PluginDescriptor;
import com.intellij.openapi.extensions.PluginId;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import com.intellij.util.ReflectionUtil;
import com.intellij.util.messages.MessageBus;
import org.jetbrains.annotations.NotNull;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.GlobalScope;
/**
*
* @author [email protected]
*/
public abstract class PayaraCloudProject implements Project {

private final Project project;

private final PsiFile buildFile;

protected PayaraCloudProject(Project project, PsiFile buildFile) {
this.project = project;
this.buildFile = buildFile;
}

public <T> T instantiateClass(@NotNull Class<T> aClass, @NotNull PluginId pluginId) {
return ReflectionUtil.newInstance(aClass, false);
}

public Project getProject() {
return project;
}

public PsiFile getBuildFile() {
return buildFile;
}

public abstract String getProjectName();

public abstract String getLoginCommand();

public abstract String getDevCommand();

public abstract String getDeployCommand();

public abstract String getUndeployCommand();

public abstract String getStartCommand();

public abstract String getStopCommand();

public abstract String getApplicationCommand();

public abstract String getNamespaceCommand();

public abstract String getSubscriptionCommand();

@Override
public String getName() {
return project.getName();
}

@Override
public VirtualFile getBaseDir() {
return project.getBaseDir();
}

@Override
public String getBasePath() {
return project.getBasePath();
}

@Override
public VirtualFile getProjectFile() {
return project.getProjectFile();
}

@Override
public String getProjectFilePath() {
return project.getProjectFilePath();
}

@Override
public VirtualFile getWorkspaceFile() {
return project.getWorkspaceFile();
}

@Override
public String getLocationHash() {
return project.getLocationHash();
}

@Override
public void save() {
project.save();
}

@Override
public boolean isOpen() {
return project.isOpen();
}

@Override
public boolean isInitialized() {
return project.isInitialized();
}

@Override
public boolean isDefault() {
return project.isDefault();
}

@Override
public <T> T getComponent(Class<T> type) {
return project.getComponent(type);
}

@Override
public MessageBus getMessageBus() {
return project.getMessageBus();
}

@Override
public boolean isDisposed() {
return project.isDisposed();
}

@Override
public Condition<?> getDisposed() {
return project.getDisposed();
}

@Override
public <T> T getUserData(Key<T> key) {
return project.getUserData(key);
}

@Override
public <T> void putUserData(Key<T> key, T t) {
project.putUserData(key, t);
}

@Override
public void dispose() {
project.dispose();
}

public CoroutineScope getCoroutineScope() {
return GlobalScope.INSTANCE;
}

@Override
public <@NotNull T> T instantiateClass(@NotNull String baseClass, PluginDescriptor pluginDescriptor) {
return getProject().instantiateClass(baseClass, pluginDescriptor);
}

@Override
public ExtensionsArea getExtensionArea() {
return getProject().getExtensionArea();
}

@Override
public boolean hasComponent(@NotNull Class<?> interfaceClass) {
return getProject().hasComponent(interfaceClass);
}

}
Loading

0 comments on commit edfe83f

Please sign in to comment.