Skip to content

Commit

Permalink
Merge pull request #65 from NixOS/updatedeps
Browse files Browse the repository at this point in the history
Update Gradle and other build dependencies
  • Loading branch information
JojOatXGME committed Oct 22, 2023
2 parents 78163f7 + d1eb7a7 commit df0a323
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 65 deletions.
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,93 +17,115 @@
## [0.4.0.11] - 2023-10-22

### Added

- Support for IDEA 2023.3

### Removed

- Support for IDEA 2022.2

## [0.4.0.10] - 2023-07-30

### Added

- Support for IDEA 2023.2

### Removed

- Support for IDEA 2022.1

### Fixed

- Final changes on release notes not applied to *“What’s New”* section
of published plugin

## [0.4.0.9]

### Added

- Support for [string interpolation in paths](https://nixos.org/manual/nix/stable/language/string-interpolation#path) (#60)

## [0.4.0.8]

### Added

- Highlighting of built-in functions and constants
- Support for [semantic highlighting](https://www.jetbrains.com/help/idea/configuring-colors-and-fonts.html#semantic-highlighting)
- Settings to change the colors used by the highlighter

## [0.4.0.7]

### Added

- Support for IDEA 2023.1 EAP

### Removed

- Support for IDEA 2021.3

## [0.4.0.6]

### Added

- Support for IDEA 2022.3 EAP

### Removed

- Support for IDEA 2021.2

## [0.4.0.5]

### Fixed

- Trailing commas reported as syntax error (#46)

## [0.4.0.4]

### Added

- Support for IDEA 2022.2 EAP

### Removed

- Support for IDEA 2021.1

## [0.4.0.3]

### Added

- Support for IDEA 2022.1

## [0.4.0.2]

### Added

- Support for IDEA 2021.3

### Removed

- Support for IDEA 2020.3

## [0.4.0.1]

### Added

- Support for IDEA 2021.2

### Removed

- Support for IDEA 2020.2

## [0.4.0.0]

This release features a complete rewrite of the parser and lexer within
the plugin.

### Added

- Support for the full syntax of Nix 2.3

### Changed

- Error detection and recovery has been overhauled.
- The following words are no longer treated as keywords to make the
implementation consistent with Nix 2.3:
Expand All @@ -123,33 +145,40 @@ the plugin.
easier to read.

### Fixed

- Various parsing errors (including but not limited to #8 and #13)
- Incorrect reset of parser state when modifying a file

## [0.3.0.6]

### Added

- Support for IDEA 2021.1

### Removed

- Support for IDEA 2020.1

## [0.3.0.5]

### Added

- Support line comment and block comment IDEA actions

## [0.3.0.4]

### Added

- Support for IDEA 2020.3

### Removed

- Support for IDEA 2019.3

## [0.3.0.3]

### Fixed

- Change ID of plugin back from `org.nixos.idea` in version 0.3.0.0 to
`nix-idea` from earlier versions. The different ID of version 0.3.0.0
causes *IntelliJ* and *JetBrains Marketplace* to treat version 0.3.0.0
Expand All @@ -160,6 +189,7 @@ the plugin.
## [0.3.0.0]

### Changed

- Update project to build for recent IJ versions

[Unreleased]: https://github.com/NixOS/nix-idea/compare/v0.4.0.11...HEAD
Expand Down
102 changes: 51 additions & 51 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.grammarkit.tasks.GenerateLexerTask
import org.jetbrains.grammarkit.tasks.GenerateParserTask
import org.jetbrains.intellij.tasks.RunPluginVerifierTask

plugins {
// Java support
id("java")
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij") version "1.13.3"
id("org.jetbrains.intellij") version "1.16.0"
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
id("org.jetbrains.changelog") version "2.1.0"
id("org.jetbrains.changelog") version "2.2.0"
// grammarkit - read more: https://github.com/JetBrains/gradle-grammar-kit-plugin
id("org.jetbrains.grammarkit") version "2021.2.2"
id("org.jetbrains.grammarkit") version "2022.3.2"
}

// Import variables from gradle.properties file
Expand All @@ -28,7 +29,7 @@ group = pluginGroup
version = pluginVersion

java {
sourceCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
}

// Configure project's dependencies
Expand All @@ -39,33 +40,32 @@ repositories {
dependencies {
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher") // https://github.com/gradle/gradle/issues/22333
testRuntimeOnly("org.junit.vintage:junit-vintage-engine")
}

// Configure gradle-intellij-plugin plugin.
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
intellij.pluginName.set(pluginName)
intellij.pluginName = pluginName
intellij {
version.set(platformVersion)
type.set(platformType)
updateSinceUntilBuild.set(true)
version = platformVersion
type = platformType
updateSinceUntilBuild = true
}

changelog {
repositoryUrl.set("https://github.com/NixOS/nix-idea")
lineSeparator.set("\n")
repositoryUrl = "https://github.com/NixOS/nix-idea"
lineSeparator = "\n"
// Workarounds because our version numbers do not match the format of semantic versioning:
headerParserRegex.set("^[-._+0-9a-zA-Z]+\$")
combinePreReleases.set(false)
headerParserRegex = "^[-._+0-9a-zA-Z]+\$"
combinePreReleases = false
}

grammarKit {
// version of IntelliJ patched JFlex (see bintray link below), Default is 1.7.0-1
jflexRelease.set("1.7.0-1")
jflexRelease = "1.7.0-1"

// tag or short commit hash of Grammar-Kit to use (see link below). Default is 2020.1
grammarKitRelease.set("2021.1.2")
grammarKitRelease = "2021.1.2"
}

sourceSets {
Expand Down Expand Up @@ -118,7 +118,7 @@ tasks {
withType<org.jetbrains.intellij.tasks.RunIdeBase> {
project.file("jbr/bin/java")
.takeIf { it.exists() }
?.let { projectExecutable.set(it.toString()) }
?.let { projectExecutable = it.toString() }
?: tasksUsingDownloadedJbr.add(this)
}

Expand All @@ -130,7 +130,7 @@ tasks {
task("metadata") {
outputs.upToDateWhen { false }
doLast {
val dir = project.buildDir.resolve("metadata")
val dir = project.layout.buildDirectory.dir("metadata").get().asFile
dir.mkdirs()
dir.resolve("version.txt").writeText(pluginVersion)
dir.resolve("zipfile.txt").writeText(buildPlugin.get().archiveFile.get().toString())
Expand All @@ -146,18 +146,18 @@ tasks {
}

val generateNixLexer by registering(GenerateLexerTask::class) {
source.set("src/main/lang/Nix.flex")
targetDir.set("src/gen/java/org/nixos/idea/lang")
targetClass.set("_NixLexer")
purgeOldFiles.set(true)
sourceFile = file("src/main/lang/Nix.flex")
targetDir = "src/gen/java/org/nixos/idea/lang"
targetClass = "_NixLexer"
purgeOldFiles = true
}

val generateNixParser by registering(GenerateParserTask::class) {
source.set("src/main/lang/Nix.bnf")
targetRoot.set("src/gen/java")
pathToParser.set("/org/nixos/idea/lang/NixParser")
pathToPsiRoot.set("/org/nixos/idea/psi")
purgeOldFiles.set(true)
sourceFile = file("src/main/lang/Nix.bnf")
targetRoot = "src/gen/java"
pathToParser = "/org/nixos/idea/lang/NixParser"
pathToPsiRoot = "/org/nixos/idea/psi"
purgeOldFiles = true
}

compileJava {
Expand All @@ -169,41 +169,41 @@ tasks {
}

patchPluginXml {
version.set(pluginVersion)
sinceBuild.set(pluginSinceBuild)
untilBuild.set(pluginUntilBuild)
version = pluginVersion
sinceBuild = pluginSinceBuild
untilBuild = pluginUntilBuild

// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
pluginDescription.set(
projectDir.resolve("README.md").readText().lines().run {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"

if (!containsAll(listOf(start, end))) {
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
}
subList(indexOf(start) + 1, indexOf(end))
}.joinToString("\n").run { markdownToHTML(this) }
)
pluginDescription = projectDir.resolve("README.md").readText().lines().run {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"

if (!containsAll(listOf(start, end))) {
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
}
subList(indexOf(start) + 1, indexOf(end))
}.joinToString("\n").run { markdownToHTML(this) }

// Get the latest available change notes from the changelog file
changeNotes.set(provider { with(changelog) {
renderItem(
(getOrNull(pluginVersion) ?: getUnreleased())
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML
)
}})
changeNotes = provider {
with(changelog) {
renderItem(
(getOrNull(pluginVersion) ?: getUnreleased())
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML
)
}
}
}

runPluginVerifier {
failureLevel.set(org.jetbrains.intellij.tasks.RunPluginVerifierTask.FailureLevel.ALL)
failureLevel = RunPluginVerifierTask.FailureLevel.ALL
}

publishPlugin {
token.set(System.getenv("JETBRAINS_TOKEN"))
channels.set(listOf(pluginVersion.split('-').getOrElse(1) { "default" }.split('.').first()))
token = System.getenv("JETBRAINS_TOKEN")
channels = listOf(pluginVersion.split('-').getOrElse(1) { "default" }.split('.').first())
}

}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit df0a323

Please sign in to comment.