Skip to content

Commit

Permalink
Use Gradle for building
Browse files Browse the repository at this point in the history
  • Loading branch information
vilinfield committed Sep 25, 2022
1 parent 6ea5d2b commit 2348733
Show file tree
Hide file tree
Showing 42 changed files with 737 additions and 52 deletions.
12 changes: 4 additions & 8 deletions .gitignore
Expand Up @@ -2,13 +2,9 @@
.idea/workspace.xml
.idea/uiDesigner.xml

# Jflex Files
jflex-*.jar
idea-flex.skeleton

# Build Files
out/
dust_syntax.jar
# Gradle Files
.gradle
build/

# Dust.flex and Dust.bnf Generated Files
gen/
src/gen/
6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions .idea/modules.xml

This file was deleted.

18 changes: 8 additions & 10 deletions README.md
@@ -1,6 +1,6 @@
# Dust Plugin for Intellij

[Dust.js](http://linkedin.github.com/dustjs/) Template Support.
[Dust.js](https://github.com/linkedin/dustjs) Template Support.

Provides syntax highlighting for the Dust.js Templating Language, goto declaration on dust partial tags and support
within standard HTML documents.
Expand All @@ -18,7 +18,7 @@ Plugin is available from the [Jetbrains plugin repository](https://plugins.jetbr

### Manual Install

1. Download the latest jar from [GitHub Releases](https://github.com/vilinfield/Intellij-Dust/releases).
1. Download the latest zip file (or jar for versions < 0.4.2) from [GitHub Releases](https://github.com/vilinfield/Intellij-Dust/releases).
2. Go to File -> Settings -> Plugins -> Install plugin from disk.

### After Installation
Expand All @@ -28,23 +28,21 @@ Plugin is available from the [Jetbrains plugin repository](https://plugins.jetbr

## Developer Notes

1. Open the project with Intellij. The project is already setup to be an Intellij Plugin Module and should have the
build settings configured. The only build dependency is the IDEA SDK. However, you may need to configure the SDK
version and location specific to your system.
1. Open the project with Intellij. The project is already setup to be a Gradle IntelliJ Plugin and should have the
build settings already configured. The only dependency is a Java 11 SDK which may need to be configured for your system.
2. Install the [Grammar-Kit](https://plugins.jetbrains.com/plugin/?id=6606) plugin.
3. You will need the Grammar-Kit to generate the parser source files from Dust.bnf and JFlex to generate the DustLexer
3. You will need Grammar-Kit to generate the parser source files from Dust.bnf and JFlex to generate the DustLexer
from Dust.flex. Since the generated sources are not checked into version control, you need to remember to generate
the lexer/parser before compiling.
4. Build the plugin from the standard build configuration and then generate the installable jar using
Build -> Prepare Plugin Module 'dustsyntax' For Deployment.
the lexer/parser before compiling using the generateParser and generateLexer Gradle tasks.
4. Build the plugin and prepare it for deployment using the buildPlugin Gradle task.
5. (Optional) Install [PSI Viewer](https://plugins.jetbrains.com/plugin/?id=227) plugin which lets you see the parse
tree graphically.

## Release Notes

**Version 0.4.2**

* Add support for newer versions of Intellij > 2022.2
* Improve compatability with newer Intellij releases

**Version 0.4.1**

Expand Down
63 changes: 63 additions & 0 deletions build.gradle.kts
@@ -0,0 +1,63 @@
fun properties(key: String) = project.findProperty(key).toString()

plugins {
id("java")
id("org.jetbrains.intellij") version "1.9.0"
id("org.jetbrains.grammarkit") version "2021.2.2"
}

group = properties("pluginGroup")
version = properties("pluginVersion")

repositories {
mavenCentral()
}

sourceSets {
named("main") {
java.srcDir("src/gen")
}
}

intellij {
pluginName.set(properties("pluginName"))
version.set(properties("platformVersion"))
type.set(properties("platformType"))
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
}

grammarKit {
jflexRelease.set("1.7.0-2")
grammarKitRelease.set("2021.1.2")
}

tasks {
properties("javaVersion").let {
withType<JavaCompile> {
sourceCompatibility = it
targetCompatibility = it
}
}
wrapper {
gradleVersion = properties("gradleVersion")
}
patchPluginXml {
version.set(properties("pluginVersion"))
sinceBuild.set(properties("pluginSinceBuild"))
untilBuild.set(properties("pluginUntilBuild"))
}
withType<org.jetbrains.grammarkit.tasks.GenerateParserTask> {
source.set("src/main/java/com/github/vilinfield/dust/Dust.bnf")
targetRoot.set("src/gen")
pathToParser.set("com/github/vilinfield/dust/parser/DustParser.java")
pathToPsiRoot.set("com/github/vilinfield/dust/psi")
purgeOldFiles.set(true)
}
withType<org.jetbrains.grammarkit.tasks.GenerateLexerTask> {
source.set("src/main/java/com/github/vilinfield/dust/Dust.flex")
targetDir.set("src/gen/com/github/vilinfield/dust/")
targetClass.set("DustLexer")
skeleton.set(file("src/main/java/com/github/vilinfield/dust/idea-flex.skeleton"))
purgeOldFiles.set(true)
}
}
18 changes: 0 additions & 18 deletions dust_syntax.iml

This file was deleted.

18 changes: 18 additions & 0 deletions gradle.properties
@@ -0,0 +1,18 @@
pluginGroup = com.github.vilinfield.dust
pluginName = Dust.js

pluginVersion = 0.4.2

pluginSinceBuild = 203
pluginUntilBuild =

platformType = IC
platformVersion = 2020.3.4

platformPlugins =

javaVersion = 11

gradleVersion = 7.5.1

kotlin.stdlib.default.dependency = false
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 2348733

Please sign in to comment.