Skip to content

Commit f76bd0a

Browse files
committed
Sketch fluid plugin and clean up multi build
1 parent b06e8da commit f76bd0a

File tree

248 files changed

+1408
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+1408
-202
lines changed

.travis.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@ cache:
1616

1717
matrix:
1818
include:
19-
- env: IDEA_VERSION="IU-182.3341.11" PHP_PLUGIN_VERSION="182.3341.34" PSI_VIEWER_PLUGIN_VERSION=182.2757.2 DEPLOY=true
20-
# - env: IDEA_VERSION="IU-173.4127.17" PHP_PLUGIN_VERSION="173.4127.13"
21-
# allow_failures:
22-
# - env: IDEA_VERSION="IU-173.4127.17" PHP_PLUGIN_VERSION="173.4127.13"
19+
- env: IDEA_VERSION="IU-2017.3.6" PHP_PLUGIN_VERSION="173.4674.46" PSI_VIEWER_PLUGIN_VERSION="3.28.93" SINCE_BUILD="173" UNTIL_BUILD="173.*"
20+
- env: IDEA_VERSION="IU-2018.1.5" PHP_PLUGIN_VERSION="181.5281.35" PSI_VIEWER_PLUGIN_VERSION="2018.1.2" SINCE_BUILD="181" UNTIL_BUILD="181.*"
21+
- env: IDEA_VERSION="IU-182.3341.11" PHP_PLUGIN_VERSION="182.3341.34" PSI_VIEWER_PLUGIN_VERSION="182.2757.2" SINCE_BUILD="182" UNTIL_BUILD="182.*"
22+
allow_failures:
23+
- env: IDEA_VERSION="IU-182.3341.11" PHP_PLUGIN_VERSION="182.3341.34" PSI_VIEWER_PLUGIN_VERSION=182.2757.2 SINCE_BUILD="182" UNTIL_BUILD="182.*"
2324

2425
before_install:
2526
- "export ORG_GRADLE_PROJECT_ideaVersion=${IDEA_VERSION}"
2627
- "export ORG_GRADLE_PROJECT_ideaType=${IDEA_TYPE}"
2728
- "export ORG_GRADLE_PROJECT_phpPluginVersion=${PHP_PLUGIN_VERSION}"
2829
- "export ORG_GRADLE_PROJECT_psiViewerPluginVersion=${PSI_VIEWER_PLUGIN_VERSION}"
30+
- "export ORG_GRADLE_PROJECT_customSinceBuild=${SINCE_BUILD}"
31+
- "export ORG_GRADLE_PROJECT_customUntilBuild=${UNTIL_BUILD}"
2932
- java -version
3033

3134
script:
@@ -35,12 +38,15 @@ script:
3538
deploy:
3639
provider: releases
3740
api_key: "${GITHUB_KEY}"
38-
file: build/distributions/TYPO3*.zip
41+
file:
42+
- lang-fluid/build/distributions/TYPO3*.zip
43+
- lang-typoscript/build/distributions/TYPO3*.zip
44+
- typo3-cms/build/distributions/TYPO3*.zip
3945
skip_cleanup: true
4046
file_glob: true
4147
on:
4248
tags: true
4349
condition: "$TRAVIS_TAG =~ ^v[0-9]+.*$"
4450

4551
after_deploy:
46-
- "./gradlew publishPlugin"
52+
- "./gradlew :typo3-cms:publishPlugin"

build.gradle

Lines changed: 33 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
2-
import org.jetbrains.grammarkit.tasks.*
32

43
buildscript {
54
repositories {
@@ -18,155 +17,67 @@ buildscript {
1817

1918
plugins {
2019
id "org.jetbrains.intellij" version "0.3.4"
21-
id 'com.palantir.git-version' version "0.9.1"
20+
id 'com.palantir.git-version' version "0.11.0"
2221
}
2322

23+
def details = versionDetails()
24+
2425
group 'com.cedricziel.idea'
25-
version gitVersion()
2626

2727
allprojects {
28-
apply plugin: 'idea'
29-
apply plugin: 'org.jetbrains.grammarkit'
30-
apply plugin: 'org.jetbrains.intellij'
3128
apply plugin: 'java'
29+
sourceCompatibility = javaVersion
30+
targetCompatibility = javaTargetVersion
31+
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
3232

33-
repositories {
34-
mavenCentral()
33+
if (details.isCleanTag) {
34+
version = "${details.lastTag}.$customSinceBuild"
35+
} else {
36+
version = "${details.lastTag}.$customSinceBuild-${details.gitHash}-SNAPSHOT"
3537
}
3638

3739
intellij {
3840
version ideaVersion
39-
downloadSources !Boolean.valueOf(System.getenv('CI'))
40-
41-
publishPlugin {
42-
username System.getenv('IJ_REPO_USERNAME')
43-
password System.getenv('IJ_REPO_PASSWORD')
44-
}
45-
46-
patchPluginXml {
47-
sinceBuild '173'
48-
untilBuild '182.*'
49-
}
41+
updateSinceUntilBuild true
5042
}
5143

52-
grammarKit {
53-
grammarKitRelease = "2017.1.4"
54-
jflexRelease = '1.7.0-1'
55-
}
56-
}
57-
58-
project(":") {
59-
intellij {
60-
pluginName 'TYPO3 CMS Plugin'
61-
plugins = [
62-
"com.jetbrains.php:${phpPluginVersion}",
63-
'CSS',
64-
'java-i18n',
65-
'properties',
66-
'yaml',
67-
"PsiViewer:${psiViewerPluginVersion}",
68-
project('lang-fluid'),
69-
project('lang-typoscript'),
70-
]
71-
}
72-
}
73-
74-
project(":lang-fluid") {
75-
def genRoot = file('gen')
76-
sourceSets {
77-
main {
78-
java.srcDirs 'src', genRoot
79-
resources.srcDir 'resources'
80-
}
81-
test {
82-
java.srcDir 'test'
83-
resources.srcDirs 'testData'
44+
patchPluginXml {
45+
if (customSinceBuild) {
46+
sinceBuild customSinceBuild
8447
}
85-
}
86-
87-
idea {
88-
module {
89-
generatedSourceDirs += genRoot
48+
if (customUntilBuild) {
49+
untilBuild customUntilBuild
9050
}
9151
}
92-
93-
intellij {
94-
pluginName 'TYPO3 Fluid Plugin'
95-
plugins = [
96-
"com.jetbrains.php:${phpPluginVersion}",
97-
'CSS',
98-
'java-i18n',
99-
'properties',
100-
'yaml',
101-
"PsiViewer:${psiViewerPluginVersion}"
102-
]
103-
}
104-
105-
task generateFluidLexer(type: GenerateLexer) {
106-
source = "src/main/grammars/FluidLexer.flex"
107-
targetDir = "gen/com/cedricziel/idea/fluid/lang/lexer"
108-
targetClass = "FluidLexer"
109-
}
110-
111-
task generateFluidParser(type: GenerateParser) {
112-
source = "src/main/grammars/FluidParser.bnf"
113-
targetRoot = 'gen'
114-
pathToParser = '/com/cedricziel/idea/fluid/lang/parser/FluidParserGenerated.java'
115-
pathToPsiRoot = '/com/cedricziel/idea/fluid/lang/psi'
116-
}
117-
118-
compileJava {
119-
dependsOn generateFluidParser, generateFluidLexer
120-
}
12152
}
12253

123-
project(":lang-typoscript") {
124-
def genRoot = file('gen')
125-
sourceSets {
126-
main {
127-
java.srcDirs 'src', genRoot
128-
resources.srcDir 'resources'
129-
}
130-
test {
131-
java.srcDir 'test'
132-
resources.srcDirs 'testData'
133-
}
134-
}
54+
subprojects {
55+
apply plugin: 'idea'
56+
apply plugin: 'org.jetbrains.grammarkit'
57+
apply plugin: 'org.jetbrains.intellij'
58+
apply plugin: 'java'
13559

136-
idea {
137-
module {
138-
generatedSourceDirs += genRoot
139-
}
60+
repositories {
61+
mavenCentral()
14062
}
14163

14264
intellij {
143-
pluginName 'TypoScript Plugin'
144-
plugins = [
145-
"com.jetbrains.php:${phpPluginVersion}",
146-
'CSS',
147-
'java-i18n',
148-
'properties',
149-
'yaml',
150-
"PsiViewer:${psiViewerPluginVersion}"
151-
]
65+
version ideaVersion
66+
downloadSources !Boolean.valueOf(System.getenv('CI'))
67+
sameSinceUntilBuild Boolean.valueOf(isEAP)
15268
}
15369

154-
task generateTypoScriptLexer(type: GenerateLexer) {
155-
source = "src/main/grammars/TypoScriptLexer.flex"
156-
targetDir = "gen/com/cedricziel/idea/typoscript/lang/lexer"
157-
targetClass = "TypoScriptLexer"
70+
publishPlugin {
71+
username System.getenv('IJ_REPO_USERNAME')
72+
password System.getenv('IJ_REPO_PASSWORD')
15873
}
15974

160-
task generateTypoScriptParser(type: GenerateParser) {
161-
source = "src/main/grammars/TypoScriptParser.bnf"
162-
targetRoot = 'gen'
163-
pathToParser = '/com/cedricziel/idea/typoscript/lang/parser/TypoScriptParserGenerated.java'
164-
pathToPsiRoot = '/com/cedricziel/idea/typoscript/lang/psi'
75+
grammarKit {
76+
grammarKitRelease = "2017.1.4"
77+
jflexRelease = '1.7.0-1'
16578
}
16679

167-
compileJava {
168-
dependsOn generateTypoScriptParser, generateTypoScriptLexer
169-
}
80+
test.testLogging.exceptionFormat = TestExceptionFormat.FULL
17081
}
17182

17283
wrapper {

gradle.properties

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1+
javaVersion = 1.8
2+
javaTargetVersion = 1.8
3+
4+
buildNumber = SNAPSHOT
5+
isEAP = false
6+
customSinceBuild = 182
7+
customUntilBuild = 182.*
8+
19
ideaVersion = IU-182.3341.11
210
phpPluginVersion = 182.3341.34
311
psiViewerPluginVersion = 182.2757.2
412

5-
#ideaVersion = IU-2018.1.4
6-
#phpPluginVersion = 181.5087.24
7-
#ideaVersion = IU-2017.3.3
8-
#phpPluginVersion = 173.4301.34
13+
#ideaVersion = IU-2018.1.5
14+
#phpPluginVersion = 181.5281.35
15+
#psiViewerPluginVersion = 2018.1.2
16+
17+
#ideaVersion = IU-2017.3.6
18+
#phpPluginVersion = 173.4674.46
19+
#psiViewerPluginVersion = 3.28.93

lang-fluid/build.gradle

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
5+
maven { url "https://jetbrains.bintray.com/intellij-third-party-dependencies" }
6+
7+
maven { url 'https://jitpack.io' }
8+
maven { url 'http://dl.bintray.com/jetbrains/intellij-plugin-service' }
9+
}
10+
11+
dependencies {
12+
classpath "com.github.JetBrains:gradle-grammar-kit-plugin:2018.1.2"
13+
}
14+
}
15+
16+
import org.jetbrains.grammarkit.tasks.GenerateLexer
17+
import org.jetbrains.grammarkit.tasks.GenerateParser
18+
19+
def genRoot = file('gen')
20+
sourceSets {
21+
main {
22+
java.srcDirs += genRoot
23+
resources.srcDir 'resources'
24+
}
25+
test {
26+
java.srcDir 'test'
27+
resources.srcDirs 'testData'
28+
}
29+
}
30+
31+
idea {
32+
module {
33+
generatedSourceDirs += genRoot
34+
}
35+
}
36+
37+
intellij {
38+
version ideaVersion
39+
pluginName 'TYPO3 Fluid Plugin'
40+
plugins = [
41+
"com.jetbrains.php:${phpPluginVersion}",
42+
'uml',
43+
'CSS',
44+
'java-i18n',
45+
'properties',
46+
'yaml',
47+
"PsiViewer:${psiViewerPluginVersion}"
48+
]
49+
}
50+
51+
publishPlugin {
52+
channels 'nightly'
53+
}
54+
55+
task generateFluidLexer(type: GenerateLexer) {
56+
source = "src/main/grammars/FluidLexer.flex"
57+
targetDir = "gen/com/cedricziel/idea/fluid/lang/lexer"
58+
targetClass = "_FluidLexer"
59+
}
60+
61+
task generateFluidParser(type: GenerateParser) {
62+
source = "src/main/grammars/FluidParser.bnf"
63+
targetRoot = 'gen'
64+
pathToParser = '/com/cedricziel/idea/fluid/lang/parser/FluidParserGenerated.java'
65+
pathToPsiRoot = '/com/cedricziel/idea/fluid/lang/psi'
66+
}
67+
68+
compileJava {
69+
dependsOn generateFluidParser, generateFluidLexer
70+
}
71+
72+
clean.doLast {
73+
file('gen').deleteDir()
74+
}

lang-fluid/src/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# TYPO3 Fluid plugin for IntelliJ based IDEs
2+
3+
This plugin is in an early draft stage. The project aims to provide
4+
a fully OpenSource plugin for the Fluid Template Language.
5+
6+
## Thoughts
7+
8+
In no particular order, these are measures we can implement to make sure,
9+
the language integrates nicely in the context. What's needed, is both
10+
an integration into the HTML Language (which is XML, internally), and
11+
a template language that resembles the inline syntax.
12+
13+
* use TemplateLanguage to be able to embed the fluid inside any outer template
14+
* use XmlAttributeDescriptorsProvider (https://github.com/JetBrains/intellij-plugins/blob/master/AngularJS/src/org/angularjs/codeInsight/attributes/AngularJSAttributeDescriptorsProvider.java)
15+
to provide valid XML attributes
16+
* use HtmlXmlExtension to fix XML Validation errors (https://github.com/JetBrains/intellij-plugins/blob/master/AngularJS/src/org/angularjs/codeInsight/AngularJSHtmlExtension.java)
17+
this should be used to implicitly provide namespaces (such as f, which is always available)
18+
* IntentionAndInspectionFilter to filter external inspections on a element
19+
(https://github.com/JetBrains/intellij-plugins/blob/master/AngularJS/src/org/angularjs/codeInsight/AngularJSInspectionFilter.java)
20+
* provide tags and element descriptors
21+
https://github.com/JetBrains/intellij-plugins/blob/master/AngularJS/src/org/angularjs/codeInsight/tags/AngularJSTagDescriptorsProvider.java
22+
* Extend XMLLanguage and replace if applicable? https://github.com/JetBrains/intellij-plugins/blob/master/AngularJS/src/org/angularjs/html/Angular2HTMLLanguage.java
23+
* add PostfixTemplateProvider for easier loops
24+
* add LiveTemplateProvider
25+
* allow Injection of other languages through `AbstractLanguageInjectionSupport`
26+
27+
## License
28+
29+
MIT

0 commit comments

Comments
 (0)