Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,21 @@ jobs:
os: [ubuntu-latest, windows-latest]

steps:
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
if: matrix.os == 'ubuntu-latest'
uses: jlumbroso/[email protected]
with:
tool-cache: false
large-packages: false

- uses: actions/[email protected]
with:
submodules: true

- uses: actions/[email protected]
with:
java-version: '17'
java-version: '21'
distribution: 'zulu'

- run: ./gradlew assemble
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,20 @@ jobs:
runs-on: ubuntu-latest

steps:
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/[email protected]
with:
tool-cache: false
large-packages: false

- uses: actions/[email protected]
with:
submodules: true

- uses: actions/[email protected]
with:
java-version: '17'
java-version: '21'
distribution: 'zulu'

- run: ./gradlew buildPlugin
Expand Down
55 changes: 33 additions & 22 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,54 +1,65 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.intellij.platform.gradle.TestFrameworkType

plugins {
// Java support
id("java")
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.9.25"
id("org.jetbrains.kotlin.jvm") version "2.2.21"
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij") version "1.17.4"
id("org.jetbrains.intellij.platform") version "2.10.1"
}

group = "com.emberjs"
version = "2024.1.1"
version = "2024.3.1"

// Configure project's dependencies
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
dependencies {
intellijPlatform {
create("IU", "2024.3.6")
plugins(listOf("com.dmarcotte.handlebars:243.21565.122"))
bundledPlugins(listOf("JavaScript", "com.intellij.css", "org.jetbrains.plugins.yaml"))
testFramework(TestFrameworkType.Platform)
}
implementation("org.codehaus.jettison:jettison:1.5.4")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.assertj:assertj-core:3.27.6")
testImplementation("org.junit.platform:junit-platform-launcher:1.11.0")
implementation(kotlin("test"))
}

// Configure gradle-intellij-plugin plugin.
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
intellij {
pluginName.set("Ember.js")

// see https://www.jetbrains.com/intellij-repository/releases/
// and https://www.jetbrains.com/intellij-repository/snapshots/
version.set("2024.1")
type.set("IU")

downloadSources.set(!System.getenv().containsKey("CI"))
updateSinceUntilBuild.set(true)
intellijPlatform {
pluginConfiguration {
name.set("Ember.js")
}

// Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
// Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
//
// com.dmarcotte.handlebars: see https://plugins.jetbrains.com/plugin/6884-handlebars-mustache/versions
plugins.set(listOf("JavaScript", "com.intellij.css", "yaml", "com.dmarcotte.handlebars:241.14494.150"))
sandboxContainer.set(project.rootDir.resolve(".sandbox"))

sandboxDir.set(project.rootDir.canonicalPath + "/.sandbox")
pluginVerification {
ides {
recommended()
}
}
}

tasks {
withType<JavaCompile> {
sourceCompatibility = "17"
targetCompatibility = "17"
sourceCompatibility = "21"
targetCompatibility = "21"
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
}
}

publishPlugin {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
12 changes: 7 additions & 5 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -112,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
CLASSPATH="\\\"\\\""


# Determine the Java command to use to start the JVM.
Expand Down Expand Up @@ -203,15 +205,15 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"

# Stop when "xargs" is not available.
Expand Down
6 changes: 4 additions & 2 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -68,11 +70,11 @@ goto fail
:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
set CLASSPATH=


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/com/emberjs/cli/EmberCliProjectGenerator.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.emberjs.cli

import com.emberjs.icons.EmberIcons
import com.intellij.execution.filters.Filter
import com.intellij.javascript.nodejs.util.NodePackage
import com.intellij.lang.javascript.boilerplate.NpmPackageProjectGenerator
import com.intellij.openapi.module.Module
Expand Down Expand Up @@ -29,7 +30,7 @@ open class EmberCliProjectGenerator : NpmPackageProjectGenerator() {

override fun generatorArgs(project: Project, baseDir: VirtualFile) = arrayOf("init", "--name=${baseDir.name}")

override fun filters(project: Project, baseDir: VirtualFile) = arrayOf(EmberCliFilter(project, baseDir.path))
override fun filters(project: Project, baseDir: VirtualFile): Array<Filter> = arrayOf(EmberCliFilter(project, baseDir.path))

override fun customizeModule(baseDir: VirtualFile, entry: ContentEntry?) = Unit

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
package com.emberjs.configuration.test

import com.intellij.execution.testframework.TestConsoleProperties
import com.intellij.execution.testframework.sm.runner.OutputLineSplitter
import com.intellij.execution.testframework.sm.runner.OutputEventSplitter
import com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter
import com.intellij.openapi.util.Key

class EmberTestOutputToGeneralTestEventsConverter(testFrameworkName: String, consoleProperties: TestConsoleProperties) :
OutputToGeneralTestEventsConverter(testFrameworkName, consoleProperties) {
var splitter: OutputLineSplitter

init {
splitter = object : OutputLineSplitter(true) {
override fun onLineAvailable(text: String, outputType: Key<*>, tcLikeFakeOutput: Boolean) {
processConsistentText(text, outputType, tcLikeFakeOutput)
}
private val splitter = object : OutputEventSplitter(true) {
override fun onTextAvailable(text: String, outputType: Key<*>) {
processConsistentText(text, outputType)
}
}

override fun process(text: String, outputType: Key<*>) {
splitter.process(text, outputType)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TemplateLintConfiguration(project: Project) : JSLinterConfiguration<Templa
}

override fun savePrivateSettings(state: TemplateLintState) {
this.myPackage.force(state.interpreterRef, state.templateLintPackage)
this.myPackage.force(state.interpreterRef, state.nodePackageRef)
}

override fun toXml(state: TemplateLintState): Element? {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import com.intellij.javascript.nodejs.PackageJsonData
import com.intellij.lang.javascript.JSBundle
import com.intellij.lang.javascript.JavaScriptBundle
import com.intellij.lang.javascript.linter.JSLinterGuesser
import com.intellij.lang.javascript.linter.JSLinterUtil
import com.intellij.notification.Notification
Expand Down Expand Up @@ -58,15 +58,15 @@ class TemplateLintEnabler : DirectoryProjectConfigurator {
}

fun notifyEnabled(project: Project, dependency: String) {
val message = JSBundle.message("js.linter.guesser.linter.enabled.because.of.package.json.section",
val message = JavaScriptBundle.message("js.linter.guesser.linter.enabled.because.of.package.json.section",
"TemplateLint",
dependency)

JSLinterUtil.NOTIFICATION_GROUP.createNotification(message, MessageType.INFO).addAction(object : NotificationAction("Disable TemplateLint") {
override fun actionPerformed(e: AnActionEvent, notification: Notification) {
JSLinterGuesser.LOG.info("TemplateLint disabled by user")
templateLintEnabled(project, false)
JSLinterUtil.NOTIFICATION_GROUP.createNotification(JSBundle.message("js.linter.guesser.linter.disabled", "TemplateLint"), MessageType.INFO).notify(project)
JSLinterUtil.NOTIFICATION_GROUP.createNotification(JavaScriptBundle.message("js.linter.guesser.linter.disabled", "TemplateLint"), MessageType.INFO).notify(project)
}
}).notify(project)
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/emberjs/utils/VirtualFileExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ fun findMainPackageJsonFile(file: VirtualFile) = file.parents.asSequence()
.map { it.findChild("package.json") }
.firstOrNull { it != null }

fun findMainPackageJson(file: VirtualFile) = findMainPackageJsonFile(file)?.let { PackageJsonData.parse(it, null) }
fun findMainPackageJson(file: VirtualFile) = findMainPackageJsonFile(file)?.let { PackageJsonData.getOrCreate(it) }