Skip to content

Commit

Permalink
Merge pull request #25 from anboralabs/sdk-v2
Browse files Browse the repository at this point in the history
upgrade sdk v2.
  • Loading branch information
mergify[bot] authored Jun 16, 2024
2 parents 4fcca14 + d1eb351 commit 5c704b2
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 37 deletions.
101 changes: 67 additions & 34 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,46 @@
fun properties(key: String) = providers.gradleProperty(key)
fun environment(key: String) = providers.environmentVariable(key)

plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version "1.9.0"
id("org.jetbrains.intellij") version "1.17.0"
id("org.jetbrains.grammarkit") version "2022.3.2.1"
id("org.jetbrains.kotlin.jvm") version "2.0.0"
id("org.jetbrains.intellij.platform") version "2.0.0-beta7"
id("org.jetbrains.grammarkit") version "2022.3.2.2"
}

group = "co.anbora.labs"
version = "1.3.5"
group = properties("pluginGroup").get()
version = properties("pluginVersion").get()

// Set the JVM language level used to build the project.
kotlin {
jvmToolchain(17)
}

// Configure project's dependencies
repositories {
mavenCentral()

// IntelliJ Platform Gradle Plugin Repositories Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html
intellijPlatform {
defaultRepositories()
}
}

dependencies {
// IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
intellijPlatform {
create(properties("platformType"), properties("platformVersion"))

// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
bundledPlugins(properties("platformBundledPlugins").map { it.split(',') })

// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
plugins(properties("platformPlugins").map { it.split(',') })

instrumentationTools()
pluginVerifier()
// testFramework(TestFrameworkType.Platform.JUnit4)
}
}

sourceSets {
Expand All @@ -18,54 +49,56 @@ sourceSets {
}
}

// Configure Gradle IntelliJ Plugin
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
version.set("2023.3")
type.set("IU") // Target IDE Platform
// Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html
intellijPlatform {
pluginConfiguration {
version = properties("pluginVersion")
description = file("src/main/html/description.html").inputStream().readBytes().toString(Charsets.UTF_8)
changeNotes = file("src/main/html/change-notes.html").inputStream().readBytes().toString(Charsets.UTF_8)

plugins.set(listOf())
ideaVersion {
sinceBuild = properties("pluginSinceBuild")
untilBuild = properties("pluginUntilBuild")
}
}

publishing {
token = environment("PUBLISH_TOKEN")
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
channels = properties("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
}

verifyPlugin {
ides {
recommended()
}
}
}

tasks {
// Set the JVM compatibility versions
withType<JavaCompile> {
sourceCompatibility = "17"
targetCompatibility = "17"

wrapper {
gradleVersion = properties("gradleVersion").get()
}

val generateFantomLexer = task<org.jetbrains.grammarkit.tasks.GenerateLexerTask>("generateFantomLexer") {
sourceFile.set(file("src/main/grammar/Fantom.flex"))
targetDir.set("src/main/gen/co/anbora/labs/fantom/lang/")
targetClass.set("FanLexer")
targetOutputDir.set(file("src/main/gen/co/anbora/labs/fantom/lang/"))
// targetClass.set("FanLexer")
purgeOldFiles.set(true)
}

val generateFantomParser = task<org.jetbrains.grammarkit.tasks.GenerateParserTask>("generateFantomParser") {
sourceFile.set(file("src/main/grammar/Fantom.bnf"))
targetRoot.set("src/main/gen")
targetRootOutputDir.set(file("src/main/gen"))
pathToParser.set("/co/anbora/labs/fantom/lang/core/parser/FantomParser.java")
pathToPsiRoot.set("/co/anbora/labs/fantom/lang/core/psi")
purgeOldFiles.set(true)
}

withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
dependsOn(generateFantomLexer, generateFantomParser)
kotlinOptions.jvmTarget = "17"
}

patchPluginXml {
sinceBuild.set("233")
untilBuild.set("241.*")
changeNotes.set(file("src/main/html/change-notes.html").inputStream().readBytes().toString(Charsets.UTF_8))
pluginDescription.set(file("src/main/html/description.html").inputStream().readBytes().toString(Charsets.UTF_8))
}

publishPlugin {
token.set(System.getenv("PUBLISH_TOKEN"))
}

buildSearchableOptions {
enabled = false
}
}
25 changes: 24 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
kotlin.stdlib.default.dependency = false
kotlin.code.style=official
kotlin.stdlib.default.dependency=false

pluginGroup = co.anbora.labs
pluginName = Fantom Lang (Community Edition)
# SemVer format -> https://semver.org
pluginVersion = 1.4.0

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 233
pluginUntilBuild = 242.*

# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType = IC
platformVersion = 242.15523.18

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP
platformPlugins =
# Example: platformBundledPlugins = com.intellij.java
platformBundledPlugins =

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 8.8
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 2 additions & 1 deletion src/main/html/change-notes.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Versions:
<ul>
<li>All Intellij products support: 1.3.5</li>
<li>All Intellij products support: 1.4.0</li>
</ul>
<br>
Plugin updates:
<ul>
<li><b>1.4.0</b> <em>(2024-06-16)</em> - upgrade sdk </li>
<li><b>1.3.5</b> <em>(2024-02-07)</em> - plugin renamed </li>
<li><b>1.3.4</b> <em>(2024-01-20)</em> - upgrade sdk </li>
<li><b>1.3.3</b> <em>(2023-12-01)</em> - upgrade sdk </li>
Expand Down

0 comments on commit 5c704b2

Please sign in to comment.