Skip to content

Commit e74ebe8

Browse files
committed
Refactor plugins - Create Core and UI plugins for base and LSP functionality. Fixes fabric8-analytics#143
Signed-off-by: Rastislav Wagner <[email protected]>
1 parent 6fb8ca3 commit e74ebe8

File tree

98 files changed

+1339
-441
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+1339
-441
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
###############################################################################
2+
# Copyright (c) 2017 Red Hat, Inc. and others.
3+
# All rights reserved. This program and the accompanying materials
4+
# are made available under the terms of the Eclipse Public License v1.0
5+
# which accompanies this distribution, and is available at
6+
# http://www.eclipse.org/legal/epl-v10.html
7+
#
8+
# Contributors:
9+
# Red Hat, Inc. - Initial implementation.
10+
##############################################################################
11+
# feature.properties
12+
# contains externalized strings for feature.xml
13+
# "%foo" in feature.xml corresponds to the key "foo" in this file
14+
# java.io.Properties file (ISO 8859-1 with "\" escapes)
15+
# This file should be translated.
16+
17+
# "featureName" property - name of the feature
18+
featureName=Fabric8Analytics Integration (Technology Preview)
19+
20+
# "providerName" property - name of the company that provides the feature
21+
providerName=JBoss by Red Hat
22+
23+
# "description" property - description of the feature
24+
description=Fabric8Analytics Integration Feature (Technology Preview)
25+
26+
# "copyright" property - text of the "Feature Update Copyright"
27+
copyright=Copyright (c) 2017 Red Hat, Inc. and others.\nAll rights reserved. This program and the accompanying materials\n
28+
are made available under the terms of the Eclipse Public License v1.0\n\
29+
which accompanies this distribution, and is available at\n\
30+
http\://www.eclipse.org/legal/epl-v10.html\n\
31+
\n\
32+
Contributors\:\n\
33+
Red Hat, Inc. - Initial implementation.\n
34+
############### end of copyright property ####################################
35+
36+
licenseURL=license.html

features/com.redhat.fabric8analytics.lsp.eclipse.feature/feature.xml renamed to features/com.redhat.fabric8analytics.eclipse.feature/feature.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<feature
3-
id="com.redhat.fabric8analytics.lsp.eclipse.feature"
3+
id="com.redhat.fabric8analytics.eclipse.feature"
44
label="%featureName"
55
version="0.0.1.qualifier"
66
provider-name="%providerName"
77
license-feature="org.jboss.tools.foundation.license.feature"
88
license-feature-version="0.0.0"
9-
plugin="com.redhat.fabric8analytics.lsp.eclipse">
9+
plugin="com.redhat.fabric8analytics.eclipse">
1010

1111
<description url="https://access.redhat.com/documentation/en/red-hat-jboss-developer-studio/">
1212
%description
@@ -20,7 +20,7 @@
2020
%license
2121
</license>
2222

23-
<plugin id="com.redhat.fabric8analytics.lsp.eclipse.core" download-size="0" install-size="0" version="0.0.0"/>
24-
<plugin id="com.redhat.fabric8analytics.lsp.eclipse.ui" download-size="0" install-size="0" version="0.0.0"/>
23+
<plugin id="com.redhat.fabric8analytics.eclipse.core" download-size="0" install-size="0" version="0.0.0"/>
24+
<plugin id="com.redhat.fabric8analytics.eclipse.ui" download-size="0" install-size="0" version="0.0.0"/>
2525

2626
</feature>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<project
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
3+
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>com.redhat.fabric8analytics.eclipse</groupId>
7+
<artifactId>features</artifactId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
</parent>
10+
<groupId>com.redhat.fabric8analytics.eclipse</groupId>
11+
<artifactId>com.redhat.fabric8analytics.eclipse.feature</artifactId>
12+
<packaging>eclipse-feature</packaging>
13+
14+
<build>
15+
<plugins>
16+
<plugin>
17+
<groupId>org.eclipse.tycho.extras</groupId>
18+
<artifactId>tycho-source-feature-plugin</artifactId>
19+
<version>${tychoExtrasVersion}</version>
20+
<executions>
21+
<execution>
22+
<id>source-feature</id>
23+
<phase>package</phase>
24+
<goals>
25+
<goal>source-feature</goal>
26+
</goals>
27+
</execution>
28+
</executions>
29+
<!-- optional excludes -->
30+
<!-- <configuration>
31+
<excludes>
32+
<plugin id="sourcefeature.bundle.nosource"/>
33+
<feature id="sourcefeature.feature.nosource"/>
34+
</excludes>
35+
</configuration>
36+
--> </plugin>
37+
<plugin>
38+
<groupId>org.eclipse.tycho</groupId>
39+
<artifactId>tycho-p2-plugin</artifactId>
40+
<version>${tychoVersion}</version>
41+
<executions>
42+
<execution>
43+
<id>attached-p2-metadata</id>
44+
<phase>package</phase>
45+
<goals>
46+
<goal>p2-metadata</goal>
47+
</goals>
48+
</execution>
49+
</executions>
50+
</plugin>
51+
</plugins>
52+
</build>
53+
</project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/bin/
2+
/.settings/
3+
/.project
4+
/.classpath
5+
target/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bin.includes = feature.xml,\
2+
feature.properties
3+
src.includes = feature.xml,\
4+
feature.properties,\
5+
build.properties
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<feature
3+
id="com.redhat.fabric8analytics.eclipse.lsp.feature"
4+
label="%featureName"
5+
version="0.0.1.qualifier"
6+
provider-name="%providerName"
7+
license-feature="org.jboss.tools.foundation.license.feature"
8+
license-feature-version="0.0.0"
9+
plugin="com.redhat.fabric8analytics.eclipse.lsp">
10+
11+
<description url="https://access.redhat.com/documentation/en/red-hat-jboss-developer-studio/">
12+
%description
13+
</description>
14+
15+
<copyright>
16+
%copyright
17+
</copyright>
18+
19+
<license url="%licenseURL">
20+
%license
21+
</license>
22+
23+
<plugin id="com.redhat.fabric8analytics.eclipse.core" download-size="0" install-size="0" version="0.0.0"/>
24+
<plugin id="com.redhat.fabric8analytics.eclipse.ui" download-size="0" install-size="0" version="0.0.0"/>
25+
<plugin id="com.redhat.fabric8analytics.eclipse.lsp.core" download-size="0" install-size="0" version="0.0.0"/>
26+
<plugin id="com.redhat.fabric8analytics.eclipse.lsp.ui" download-size="0" install-size="0" version="0.0.0"/>
27+
28+
</feature>

features/com.redhat.fabric8analytics.lsp.eclipse.feature/pom.xml renamed to features/com.redhat.fabric8analytics.eclipse.lsp.feature/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<version>0.0.1-SNAPSHOT</version>
99
</parent>
1010
<groupId>com.redhat.fabric8analytics.eclipse</groupId>
11-
<artifactId>com.redhat.fabric8analytics.lsp.eclipse.feature</artifactId>
11+
<artifactId>com.redhat.fabric8analytics.eclipse.lsp.feature</artifactId>
1212
<packaging>eclipse-feature</packaging>
1313

1414
<build>

features/com.redhat.fabric8analytics.eclipse.lsp.feature/sourceTemplateFeature/.gitkeep

Whitespace-only changes.

features/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
<artifactId>com.redhat.fabric8analytics.parent</artifactId>
88
<version>0.0.1-SNAPSHOT</version>
99
</parent>
10-
<groupId>com.redhat.fabric8analytics.eclipse</groupId>
1110
<artifactId>features</artifactId>
1211

1312
<name>com.redhat.fabric8analytics.eclipse features</name>
1413
<packaging>pom</packaging>
1514
<modules>
16-
<module>com.redhat.fabric8analytics.lsp.eclipse.feature</module>
15+
<module>com.redhat.fabric8analytics.eclipse.feature</module>
16+
<module>com.redhat.fabric8analytics.eclipse.lsp.feature</module>
1717
</modules>
1818
</project>
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %Bundle-Name
4-
Bundle-SymbolicName: com.redhat.fabric8analytics.lsp.eclipse.core;singleton:=true
4+
Bundle-SymbolicName: com.redhat.fabric8analytics.eclipse.core;singleton:=true
55
Bundle-Version: 0.0.1.qualifier
66
Bundle-Vendor: %Bundle-Vendor
77
Bundle-Localization: plugin
88
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
9-
Require-Bundle: org.eclipse.lsp4e;bundle-version="0.3.0",
10-
org.eclipse.core.runtime,
9+
Require-Bundle: org.eclipse.core.runtime,
1110
org.eclipse.core.resources;bundle-version="3.12.0",
1211
org.apache.httpcomponents.httpclient;bundle-version="4.5.2",
1312
org.apache.httpcomponents.httpcore;bundle-version="4.4.6",
@@ -18,13 +17,13 @@ Require-Bundle: org.eclipse.lsp4e;bundle-version="0.3.0",
1817
org.eclipse.m2e.core,
1918
org.eclipse.m2e.maven.runtime,
2019
org.jboss.tools.openshift.io.core
21-
Eclipse-BundleShape: dir
22-
Bundle-Activator: com.redhat.fabric8analytics.lsp.eclipse.core.Fabric8AnalysisLSCoreActivator
20+
Bundle-Activator: com.redhat.fabric8analytics.eclipse.core.Fabric8AnalysisCoreActivator
2321
Bundle-ActivationPolicy: lazy
2422
Bundle-ClassPath: .
25-
Export-Package: com.redhat.fabric8analytics.lsp.eclipse.core,
26-
com.redhat.fabric8analytics.lsp.eclipse.core.job,
27-
com.redhat.fabric8analytics.lsp.eclipse.core.data,
28-
com.redhat.fabric8analytics.lsp.eclipse.core.internal;x-friends:=com.redhat.fabric8analytics.lsp.eclipse.ui
23+
Export-Package: com.redhat.fabric8analytics.eclipse.core,
24+
com.redhat.fabric8analytics.eclipse.core.data,
25+
com.redhat.fabric8analytics.eclipse.core.internal;x-friends:="com.redhat.fabric8analytics.eclipse.lsp.core, com.redhat.fabric8analytics.eclipse.ui, com.redhat.fabric8analytics.eclipse.lsp.ui",
26+
com.redhat.fabric8analytics.eclipse.core.job,
27+
com.redhat.fabric8analytics.eclipse.core.api
2928

3029

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Bundle-Name=Fabric8Analytics Core Plugin
2+
Bundle-Vendor=JBoss by Red Hat

plugins/com.redhat.fabric8analytics.lsp.eclipse.core/pom.xml renamed to plugins/com.redhat.fabric8analytics.eclipse.core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<version>0.0.1-SNAPSHOT</version>
77
</parent>
88

9-
<artifactId>com.redhat.fabric8analytics.lsp.eclipse.core</artifactId>
9+
<artifactId>com.redhat.fabric8analytics.eclipse.core</artifactId>
1010
<packaging>eclipse-plugin</packaging>
1111

1212
</project>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Red Hat Incorporated - initial API and implementation
1010
*******************************************************************************/
1111

12-
package com.redhat.fabric8analytics.lsp.eclipse.core;
12+
package com.redhat.fabric8analytics.eclipse.core;
1313

1414
import org.eclipse.core.runtime.IStatus;
1515
import org.eclipse.core.runtime.Plugin;
@@ -19,17 +19,17 @@
1919
/**
2020
* The activator class controls the plug-in life cycle
2121
*/
22-
public class Fabric8AnalysisLSCoreActivator extends Plugin {
22+
public class Fabric8AnalysisCoreActivator extends Plugin {
2323

24-
public static final String PLUGIN_ID = "com.redhat.fabric8analytics.lsp.eclipse.core";
24+
public static final String PLUGIN_ID = "com.redhat.fabric8analytics.eclipse.core";
2525

2626
// The shared instance
27-
private static Fabric8AnalysisLSCoreActivator plugin;
27+
private static Fabric8AnalysisCoreActivator plugin;
2828

2929
/**
3030
* The constructor
3131
*/
32-
public Fabric8AnalysisLSCoreActivator() {
32+
public Fabric8AnalysisCoreActivator() {
3333
}
3434

3535
@Override
@@ -49,7 +49,7 @@ public void stop(BundleContext context) throws Exception {
4949
*
5050
* @return the shared instance
5151
*/
52-
public static Fabric8AnalysisLSCoreActivator getDefault() {
52+
public static Fabric8AnalysisCoreActivator getDefault() {
5353
return plugin;
5454
}
5555

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,17 @@
88
* Contributors:
99
* Red Hat Incorporated - initial API and implementation
1010
*******************************************************************************/
11-
package com.redhat.fabric8analytics.lsp.eclipse.core;
11+
package com.redhat.fabric8analytics.eclipse.core;
1212

1313
import org.eclipse.core.runtime.preferences.InstanceScope;
1414
import org.eclipse.equinox.security.storage.ISecurePreferences;
1515
import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
1616
import org.eclipse.equinox.security.storage.StorageException;
1717

18-
import com.redhat.fabric8analytics.lsp.eclipse.core.data.ThreeScaleData;
18+
import com.redhat.fabric8analytics.eclipse.core.data.ThreeScaleData;
1919

2020
public class Fabric8AnalysisPreferences {
2121

22-
public static final String LSP_SERVER_ENABLED = "fabric8AnalysisPreferences.LSP_ENABLED";
2322
public static final String PROD_URL = "fabric8AnalysisPreferences.PROD_URL";
2423
public static final String STAGE_URL = "fabric8AnalysisPreferences.STAGE_URL";
2524
public static final String USER_KEY = "fabric8AnalysisPreferences.USER_KEY";
@@ -39,28 +38,20 @@ public static Fabric8AnalysisPreferences getInstance() {
3938
return instance;
4039
}
4140

42-
public boolean isLSPServerEnabled() {
43-
return InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).getBoolean(LSP_SERVER_ENABLED, false);
44-
}
45-
46-
public void setLSPServerEnabled(boolean enabled) {
47-
InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).putBoolean(LSP_SERVER_ENABLED, enabled);
48-
}
49-
5041
public String getProdURL() {
51-
return InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).get(PROD_URL, null);
42+
return InstanceScope.INSTANCE.getNode(Fabric8AnalysisCoreActivator.PLUGIN_ID).get(PROD_URL, null);
5243
}
5344

5445
public void setProdURL(String prodURL) {
55-
InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).put(PROD_URL, prodURL);
46+
InstanceScope.INSTANCE.getNode(Fabric8AnalysisCoreActivator.PLUGIN_ID).put(PROD_URL, prodURL);
5647
}
5748

5849
public String getStageURL() {
59-
return InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).get(STAGE_URL, null);
50+
return InstanceScope.INSTANCE.getNode(Fabric8AnalysisCoreActivator.PLUGIN_ID).get(STAGE_URL, null);
6051
}
6152

6253
public void setStageURL(String stageURL) {
63-
InstanceScope.INSTANCE.getNode(Fabric8AnalysisLSCoreActivator.PLUGIN_ID).put(STAGE_URL, stageURL);
54+
InstanceScope.INSTANCE.getNode(Fabric8AnalysisCoreActivator.PLUGIN_ID).put(STAGE_URL, stageURL);
6455
}
6556

6657
public String getUserKey() throws StorageException {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Red Hat Incorporated - initial API and implementation
1010
*******************************************************************************/
1111

12-
package com.redhat.fabric8analytics.lsp.eclipse.core;
12+
package com.redhat.fabric8analytics.eclipse.core.api;
1313

1414
import org.json.JSONObject;
1515

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Red Hat Incorporated - initial API and implementation
1010
*******************************************************************************/
1111

12-
package com.redhat.fabric8analytics.lsp.eclipse.core;
12+
package com.redhat.fabric8analytics.eclipse.core.api;
1313

1414

1515
import java.io.File;
@@ -31,8 +31,9 @@
3131
import org.json.JSONException;
3232
import org.json.JSONObject;
3333

34-
import com.redhat.fabric8analytics.lsp.eclipse.core.data.AnalyticsAuthData;
35-
import com.redhat.fabric8analytics.lsp.eclipse.core.internal.PomContentBody;
34+
import com.redhat.fabric8analytics.eclipse.core.Fabric8AnalysisCoreActivator;
35+
import com.redhat.fabric8analytics.eclipse.core.data.AnalyticsAuthData;
36+
import com.redhat.fabric8analytics.eclipse.core.internal.PomContentBody;
3637

3738
/**
3839
* Provides access to Recommender API server
@@ -132,7 +133,7 @@ public boolean analysesFinished(String jobId) throws RecommenderAPIException {
132133
int responseCode = response.getStatusLine().getStatusCode();
133134

134135
// TODO - for debug purposes - should be removed later
135-
Fabric8AnalysisLSCoreActivator.getDefault().logInfo("F8 server response code: " + responseCode);
136+
Fabric8AnalysisCoreActivator.getDefault().logInfo("F8 server response code: " + responseCode);
136137

137138
if (responseCode == HttpStatus.SC_OK) {
138139
return true;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Red Hat Incorporated - initial API and implementation
1010
*******************************************************************************/
1111

12-
package com.redhat.fabric8analytics.lsp.eclipse.core;
12+
package com.redhat.fabric8analytics.eclipse.core.api;
1313

1414
import org.json.JSONObject;
1515

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Red Hat Incorporated - initial API and implementation
1010
*******************************************************************************/
1111

12-
package com.redhat.fabric8analytics.lsp.eclipse.core;
12+
package com.redhat.fabric8analytics.eclipse.core.api;
1313

1414
import java.io.IOException;
1515

@@ -22,7 +22,7 @@
2222
import org.json.JSONException;
2323
import org.json.JSONObject;
2424

25-
import com.redhat.fabric8analytics.lsp.eclipse.core.data.ThreeScaleData;
25+
import com.redhat.fabric8analytics.eclipse.core.data.ThreeScaleData;
2626

2727
/**
2828
* Provides access to 3scale service
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Contributors:
99
* Red Hat Incorporated - initial API and implementation
1010
*******************************************************************************/
11-
package com.redhat.fabric8analytics.lsp.eclipse.core.data;
11+
package com.redhat.fabric8analytics.eclipse.core.data;
1212

1313
public class AnalyticsAuthData {
1414

0 commit comments

Comments
 (0)