-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Associate Jenkins icon with files named 'Jenkinsfile'
- Loading branch information
1 parent
159cbe7
commit 1e1b162
Showing
8 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea/ | ||
*.iml | ||
out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<idea-plugin version="2"> | ||
<id>com.oliverlockwood.plugins.jenkinsfile</id> | ||
<name>Jenkinsfile IDEA plugin</name> | ||
<version>1.0</version> | ||
<vendor email="[email protected]" url="http://www.oliverlockwood.com">Oliver Lockwood</vendor> | ||
|
||
<description><![CDATA[ | ||
Description for plugin.<br> | ||
<em>most HTML tags may be used</em> | ||
Jenkins icon under <a href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>. See <a href="https://jenkins.io/">https://jenkins.io/</a> | ||
]]></description> | ||
|
||
<change-notes><![CDATA[ | ||
Change notes for plugin.<br> | ||
<em>most HTML tags may be used</em> | ||
]]> | ||
</change-notes> | ||
|
||
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description --> | ||
<idea-version since-build="141.0"/> | ||
|
||
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html | ||
on how to target different products --> | ||
<!-- uncomment to enable plugin in all products | ||
<depends>com.intellij.modules.lang</depends> | ||
--> | ||
|
||
<extensions defaultExtensionNs="com.intellij"> | ||
<!-- Add your extensions here --> | ||
<fileTypeFactory implementation="com.oliverlockwood.plugins.jenkinsfile.JenkinsFileTypeFactory" /> | ||
</extensions> | ||
|
||
<actions> | ||
<!-- Add your actions here --> | ||
</actions> | ||
|
||
</idea-plugin> |
38 changes: 38 additions & 0 deletions
38
src/com/oliverlockwood/plugins/jenkinsfile/JenkinsFileType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.oliverlockwood.plugins.jenkinsfile; | ||
|
||
import com.intellij.openapi.fileTypes.LanguageFileType; | ||
import org.jetbrains.annotations.*; | ||
|
||
import javax.swing.*; | ||
|
||
public class JenkinsFileType extends LanguageFileType { | ||
public static final JenkinsFileType INSTANCE = new JenkinsFileType(); | ||
|
||
private JenkinsFileType() { | ||
super(JenkinsLanguage.INSTANCE); | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public String getName() { | ||
return "Jenkins file"; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public String getDescription() { | ||
return "Jenkins language file"; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public String getDefaultExtension() { | ||
return ""; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public Icon getIcon() { | ||
return JenkinsIcons.FILE; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/com/oliverlockwood/plugins/jenkinsfile/JenkinsFileTypeFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.oliverlockwood.plugins.jenkinsfile; | ||
|
||
import com.intellij.openapi.fileTypes.*; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class JenkinsFileTypeFactory extends FileTypeFactory { | ||
@Override | ||
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) { | ||
fileTypeConsumer.consume(JenkinsFileType.INSTANCE, new ExactFileNameMatcher("Jenkinsfile")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.oliverlockwood.plugins.jenkinsfile; | ||
|
||
import com.intellij.openapi.util.IconLoader; | ||
|
||
import javax.swing.Icon; | ||
|
||
public class JenkinsIcons { | ||
public static final Icon FILE = IconLoader.getIcon("/com/oliverlockwood/plugins/jenkinsfile/icons/jenkins.png"); | ||
} |
11 changes: 11 additions & 0 deletions
11
src/com/oliverlockwood/plugins/jenkinsfile/JenkinsLanguage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.oliverlockwood.plugins.jenkinsfile; | ||
|
||
import com.intellij.lang.Language; | ||
|
||
public class JenkinsLanguage extends Language { | ||
public static final JenkinsLanguage INSTANCE = new JenkinsLanguage(); | ||
|
||
private JenkinsLanguage() { | ||
super("Jenkins"); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.