mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 09:16:02 +02:00
Bug 530000 - Add Meson Build support
Editors for meson.build, meson_options.txt and *.ninja files. Just highlighting for now based on textmate grammars. Added tm4e to target to enable resolving tm4e bundles. Change-Id: I22859b2d39a96dcd777ee96d2a5e7465e4884839 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
parent
28b36d1e3e
commit
61442cf3be
12 changed files with 397 additions and 1 deletions
|
@ -33,4 +33,11 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.cdt.meson.ui.editor"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
</feature>
|
||||
|
|
7
build/org.eclipse.cdt.meson.ui.editor/.classpath
Normal file
7
build/org.eclipse.cdt.meson.ui.editor/.classpath
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
build/org.eclipse.cdt.meson.ui.editor/.project
Normal file
28
build/org.eclipse.cdt.meson.ui.editor/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.eclipse.cdt.meson.ui.editor</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,7 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
12
build/org.eclipse.cdt.meson.ui.editor/META-INF/MANIFEST.MF
Normal file
12
build/org.eclipse.cdt.meson.ui.editor/META-INF/MANIFEST.MF
Normal file
|
@ -0,0 +1,12 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %Bundle-Name
|
||||
Bundle-SymbolicName: org.eclipse.cdt.meson.ui.editor;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Vendor: %vendorName
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Require-Bundle: org.eclipse.ui.genericeditor;bundle-version="1.0.0",
|
||||
org.eclipse.tm4e.ui;bundle-version="0.1.0",
|
||||
org.eclipse.ui.editors;bundle-version="3.11.0",
|
||||
org.eclipse.core.contenttype;bundle-version="3.6.0"
|
||||
Automatic-Module-Name: org.eclipse.cdt.meson.ui.editor
|
|
@ -0,0 +1,5 @@
|
|||
#Properties file for org.eclipse.cdt.meson.ui.editor
|
||||
Bundle-Name = Meson editor
|
||||
vendorName=Eclipse CDT
|
||||
content-type.meson = Meson
|
||||
content-type.ninja = Ninja
|
7
build/org.eclipse.cdt.meson.ui.editor/build.properties
Normal file
7
build/org.eclipse.cdt.meson.ui.editor/build.properties
Normal file
|
@ -0,0 +1,7 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
syntaxes/,\
|
||||
plugin.xml,\
|
||||
OSGI-INF/
|
45
build/org.eclipse.cdt.meson.ui.editor/plugin.xml
Normal file
45
build/org.eclipse.cdt.meson.ui.editor/plugin.xml
Normal file
|
@ -0,0 +1,45 @@
|
|||
<plugin>
|
||||
<extension point="org.eclipse.core.contenttype.contentTypes">
|
||||
<content-type id="org.eclipse.cdt.meson" name="%content-type.meson"
|
||||
base-type="org.eclipse.core.runtime.text" file-names="meson.build, meson_options.txt" />
|
||||
<content-type id="org.eclipse.cdt.ninja" name="%content-type.ninja"
|
||||
base-type="org.eclipse.core.runtime.text" file-extensions="ninja" />
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.tm4e.registry.grammars">
|
||||
<grammar
|
||||
scopeName="source.meson"
|
||||
path="syntaxes/meson.json" />
|
||||
<scopeNameContentTypeBinding
|
||||
contentTypeId="org.eclipse.cdt.meson"
|
||||
scopeName="source.meson" />
|
||||
<grammar
|
||||
scopeName="source.ninja"
|
||||
path="syntaxes/ninja.tmLanguage" />
|
||||
<scopeNameContentTypeBinding
|
||||
contentTypeId="org.eclipse.cdt.ninja"
|
||||
scopeName="source.ninja" />
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.editors">
|
||||
<editorContentTypeBinding
|
||||
contentTypeId="org.eclipse.cdt.meson"
|
||||
editorId="org.eclipse.ui.genericeditor.GenericEditor">
|
||||
</editorContentTypeBinding>
|
||||
<editorContentTypeBinding
|
||||
contentTypeId="org.eclipse.cdt.ninja"
|
||||
editorId="org.eclipse.ui.genericeditor.GenericEditor">
|
||||
</editorContentTypeBinding>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.genericeditor.presentationReconcilers">
|
||||
<presentationReconciler
|
||||
class="org.eclipse.tm4e.ui.text.TMPresentationReconciler"
|
||||
contentType="org.eclipse.cdt.meson">
|
||||
</presentationReconciler>
|
||||
<presentationReconciler
|
||||
class="org.eclipse.tm4e.ui.text.TMPresentationReconciler"
|
||||
contentType="org.eclipse.cdt.ninja">
|
||||
</presentationReconciler>
|
||||
</extension>
|
||||
</plugin>
|
167
build/org.eclipse.cdt.meson.ui.editor/syntaxes/meson.json
Normal file
167
build/org.eclipse.cdt.meson.ui.editor/syntaxes/meson.json
Normal file
|
@ -0,0 +1,167 @@
|
|||
{
|
||||
"name": "Meson",
|
||||
"scopeName": "source.meson",
|
||||
"author": "Patrick Griffis",
|
||||
"fileTypes": [
|
||||
"meson.build",
|
||||
"meson_options.txt"
|
||||
],
|
||||
"uuid": "b3713e1e-4289-4e0c-88af-79e8876e5adb",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\#.*$",
|
||||
"name": "comment.line.meson"
|
||||
},
|
||||
{
|
||||
"include": "#string_quoted_single"
|
||||
},
|
||||
{
|
||||
"match": "\\b(if|else|elif|endif|foreach|endforeach)\\b",
|
||||
"name": "keyword.control.flow.meson"
|
||||
},
|
||||
{
|
||||
"match": "\\b(and|not|or)\\b",
|
||||
"name": "keyword.operator.logical.meson"
|
||||
},
|
||||
{
|
||||
"match": "\\b(true|false)\\b",
|
||||
"name": "constant.language.meson"
|
||||
},
|
||||
{
|
||||
"match": "\\b([1-9]+[0-9]*\\.[0-9]*)",
|
||||
"name": "constant.numeric.float.meson"
|
||||
},
|
||||
{
|
||||
"match": "\\b([1-9]+[0-9]*|0)",
|
||||
"name": "constant.numeric.integer.decimal.meson"
|
||||
},
|
||||
{
|
||||
"match": "\\b(meson|host_machine|build_machine|target_machine)\\b",
|
||||
"name": "support.variable.meson"
|
||||
},
|
||||
{
|
||||
"match": "\\b([\\w_]+)\\s*(?=:)",
|
||||
"name": "variable.parameter.function.keyword.meson"
|
||||
},
|
||||
{
|
||||
"match": "<\\=|>\\=|\\=\\=|<|>|\\!\\=",
|
||||
"name": "keyword.operator.comparison.meson"
|
||||
},
|
||||
{
|
||||
"match": "\\+\\=",
|
||||
"name": "keyword.operator.assignment.augmented.meson"
|
||||
},
|
||||
{
|
||||
"match": "\\=",
|
||||
"name": "keyword.operator.assignment.meson"
|
||||
},
|
||||
{
|
||||
"match": "\\+|\\-|\\*|%|\\/",
|
||||
"name": "keyword.operator.arithmetic.meson"
|
||||
},
|
||||
{
|
||||
"match": "(?x)\\b(add_global_arguments|add_project_arguments|add_global_link_arguments|add_project_link_arguments|add_test_setup|add_languages|assert|benchmark|build_target|configuration_data|configure_file|custom_target|declare_dependency|dependency|environment|error|executable|generator|gettext|get_option|get_variable|files|find_library|find_program|include_directories|import|install_data|install_headers|install_man|install_subdir|is_variable|jar|join_paths|library|message|option|project|run_target|run_command|set_variable|subdir|subproject|shared_library|shared_module|static_library|test|vcs_tag\n)\\b\\s*(?=\\()",
|
||||
"name": "support.function.builtin.meson"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"constant_placeholder": {
|
||||
"match": "(?i:(%(\\([a-z_]+\\))?#?0?\\-?[ ]?\\+?([0-9]*|\\*)(\\.([0-9]*|\\*))?([hL][a-z]|[a-z%]))|(\\{([!\\[\\].:\\w ]+)?\\}))",
|
||||
"name": "constant.other.placeholder.meson"
|
||||
},
|
||||
"escaped_character": {
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "constant.character.escape.newline.meson"
|
||||
},
|
||||
"2": {
|
||||
"name": "constant.character.escape.backlash.meson"
|
||||
},
|
||||
"3": {
|
||||
"name": "constant.character.escape.single-quote.meson"
|
||||
},
|
||||
"4": {
|
||||
"name": "constant.character.escape.linefeed.meson"
|
||||
},
|
||||
"5": {
|
||||
"name": "constant.character.escape.return.meson"
|
||||
},
|
||||
"6": {
|
||||
"name": "constant.character.escape.tab.meson"
|
||||
}
|
||||
},
|
||||
"match": "((\\\\\\n)|(\\\\\\\\)|(\\\\')|(\\\\n)|(\\\\r)|(\\\\t))"
|
||||
},
|
||||
"string_quoted_single": {
|
||||
"patterns": [
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "puncutation.definition.string.begin.meson"
|
||||
},
|
||||
"2": {
|
||||
"name": "puncutation.definition.string.end.meson"
|
||||
},
|
||||
"3": {
|
||||
"name": "meta.empty-string.single.meson"
|
||||
}
|
||||
},
|
||||
"match": "(?<!')(')(('))(?!')",
|
||||
"name": "string.quoted.single.single-line.meson"
|
||||
},
|
||||
{
|
||||
"begin": "(''')",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.string.begin.meson"
|
||||
}
|
||||
},
|
||||
"end": "((?<=''')(')''|''')",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.string.end.meson"
|
||||
},
|
||||
"2": {
|
||||
"name": "meta.empty-string.single.meson"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.single.block.meson",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#constant_placeholder"
|
||||
},
|
||||
{
|
||||
"include": "#escaped_character"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(')",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.string.begin.meson"
|
||||
}
|
||||
},
|
||||
"end": "(')|(\\n)",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.string.end.meson"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.unclosed-string.meson"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.single.single-line.meson",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#constant_placeholder"
|
||||
},
|
||||
{
|
||||
"include": "#escaped_character"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
106
build/org.eclipse.cdt.meson.ui.editor/syntaxes/ninja.tmLanguage
Normal file
106
build/org.eclipse.cdt.meson.ui.editor/syntaxes/ninja.tmLanguage
Normal file
|
@ -0,0 +1,106 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>fileTypes</key>
|
||||
<array>
|
||||
<string>ninja</string>
|
||||
</array>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^~N</string>
|
||||
<key>name</key>
|
||||
<string>Ninja</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>^\t+(?![#\t]).*\n?</string>
|
||||
<key>name</key>
|
||||
<string>invalid.illegal.tab-not-allowed-here.ninja</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>$[$: ]</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escape.ninja</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b(build|rule|default)\b</string>
|
||||
<key>name</key>
|
||||
<string>storage.type.$1.ninja</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b(include|subninja)\b</string>
|
||||
<key>name</key>
|
||||
<string>keyword.control.$1.ninja</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.variable.ninja</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(\$)[a-zA-Z_][a-zA-Z0-9_]*</string>
|
||||
<key>name</key>
|
||||
<string>variable.other.normal.ninja</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.variable.ninja</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(\$)\{.*?\}</string>
|
||||
<key>name</key>
|
||||
<string>variable.other.bracket.ninja</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>^([ \t]+)?(?=#)</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.whitespace.comment.leading.ninja</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(?!\G)</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>#</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.ninja</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>\n</string>
|
||||
<key>name</key>
|
||||
<string>comment.line.number-sign.ninja</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>scopeName</key>
|
||||
<string>source.ninja</string>
|
||||
<key>uuid</key>
|
||||
<string>012183BB-F02F-496D-9910-3B2504674FEC</string>
|
||||
</dict>
|
||||
</plist>
|
1
pom.xml
1
pom.xml
|
@ -76,6 +76,7 @@
|
|||
|
||||
<module>build/org.eclipse.cdt.meson.core</module>
|
||||
<module>build/org.eclipse.cdt.meson.ui</module>
|
||||
<module>build/org.eclipse.cdt.meson.ui.editor</module>
|
||||
<module>build/org.eclipse.cdt.meson-feature</module>
|
||||
|
||||
<module>build/org.eclipse.cdt.core.autotools.core</module>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?pde version="3.8"?><target name="cdt" sequenceNumber="23">
|
||||
<?pde version="3.8"?><target name="cdt" sequenceNumber="24">
|
||||
<locations>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<unit id="org.antlr.runtime" version="0.0.0"/>
|
||||
|
@ -73,6 +73,10 @@
|
|||
<unit id="org.eclipse.tools.templates.ui.source" version="0.0.0"/>
|
||||
<repository location="https://hudson.eclipse.org/cdt/job/tools-templates-master/lastSuccessfulBuild/artifact/repo/target/repository/"/>
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<unit id="tm-feature.feature.group" version="0.0.0"/>
|
||||
<repository location="http://download.eclipse.org/tm4e/snapshots/"/>
|
||||
</location>
|
||||
</locations>
|
||||
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<launcherArgs>
|
||||
|
|
Loading…
Add table
Reference in a new issue