-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: badido18 <hm_boudis@esi.dz>
- Loading branch information
1 parent
ca8eaee
commit 3211982
Showing
15 changed files
with
522 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
(function (Prism) { | ||
var interpolation = { | ||
pattern: /((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/, | ||
lookbehind: true, | ||
inside: { | ||
'interpolation-punctuation': { | ||
pattern: /^\$\{?|\}$/, | ||
alias: 'punctuation', | ||
}, | ||
'expression': { | ||
pattern: /[\s\S]+/, | ||
inside: null, | ||
}, | ||
}, | ||
}; | ||
|
||
Prism.languages.gradle = Prism.languages.extend('clike', { | ||
'string': { | ||
pattern: /'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/, | ||
greedy: true, | ||
}, | ||
'keyword': | ||
/\b(?:apply|def|dependencies|else|if|implementation|import|plugin|plugins|project|repositories|repository|sourceSets|tasks|val)\b/, | ||
'number': /\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i, | ||
'operator': { | ||
pattern: | ||
/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/, | ||
lookbehind: true, | ||
}, | ||
'punctuation': /\.+|[{}[\];(),:$]/, | ||
}); | ||
|
||
Prism.languages.insertBefore('gradle', 'string', { | ||
'shebang': { | ||
pattern: /#!.+/, | ||
alias: 'comment', | ||
greedy: true, | ||
}, | ||
'interpolation-string': { | ||
pattern: | ||
/"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/, | ||
greedy: true, | ||
inside: { | ||
'interpolation': interpolation, | ||
'string': /[\s\S]+/, | ||
}, | ||
}, | ||
}); | ||
|
||
Prism.languages.insertBefore('gradle', 'punctuation', { | ||
'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/, | ||
}); | ||
|
||
Prism.languages.insertBefore('gradle', 'function', { | ||
'annotation': { | ||
pattern: /(^|[^.])@\w+/, | ||
lookbehind: true, | ||
alias: 'punctuation', | ||
}, | ||
}); | ||
|
||
interpolation.inside.expression.inside = Prism.languages.gradle; | ||
}(Prism)); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<h2>Full example</h2> | ||
<pre><code>apply plugin: "java" | ||
apply plugin: "eclipse" | ||
apply plugin: "idea" | ||
|
||
group = "com.mycompany.hadoopproject" | ||
version = "1.0" | ||
|
||
repositories { | ||
// Standard Maven | ||
mavenCentral() | ||
maven { | ||
url "https://repository.cloudera.com/artifactory/cloudera-repos/" | ||
} | ||
} | ||
|
||
// Mimic Maven 'provided' configuration, as suggested in GRADLE-784 | ||
configurations { | ||
provided | ||
} | ||
sourceSets { | ||
main { | ||
compileClasspath += configurations.provided | ||
} | ||
} | ||
|
||
ext.hadoopVersion = "2.0.0-mr1-cdh4.0.1" | ||
dependencies { | ||
provided "org.apache.hadoop:hadoop-client:${hadoopVersion}" | ||
|
||
// Example of adding a specific compile time dependency | ||
compile "com.google.guava:guava:11.0.2" | ||
|
||
testCompile "junit:junit:4.8.2" | ||
} | ||
|
||
// Java version selection | ||
sourceCompatibility = 1.6 | ||
targetCompatibility = 1.6 | ||
|
||
eclipse { | ||
classpath { | ||
// Ensure Eclipse build output appears in build directory | ||
defaultOutputDir = file("${buildDir}/eclipse-classes") | ||
// Ensure the provided configuration jars are available in Eclipse | ||
plusConfigurations += configurations.provided | ||
} | ||
} | ||
|
||
// Emulate Maven shade plugin with a fat jar. | ||
// http://docs.codehaus.org/display/GRADLE/Cookbook#Cookbook-Creatingafatjar | ||
jar { | ||
from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } | ||
}</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@BaseScript MyBaseClass baseScript | ||
@DelegatesTo(EmailSpec) | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["annotation", "@BaseScript"], | ||
" MyBaseClass baseScript\r\n", | ||
["annotation", "@DelegatesTo"], | ||
["punctuation", "("], | ||
"EmailSpec", | ||
["punctuation", ")"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for annotations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
implementation | ||
val tasks dependencies project plugin plugins | ||
repository repositories apply def sourceSets import | ||
if else | ||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "implementation"], | ||
|
||
["keyword", "val"], | ||
["keyword", "tasks"], | ||
["keyword", "dependencies"], | ||
["keyword", "project"], | ||
["keyword", "plugin"], | ||
["keyword", "plugins"], | ||
|
||
["keyword", "repository"], | ||
["keyword", "repositories"], | ||
["keyword", "apply"], | ||
["keyword", "def"], | ||
["keyword", "sourceSets"], | ||
["keyword", "import"], | ||
|
||
["keyword", "if"], | ||
["keyword", "else"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for all keywords. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
0b0110 | ||
0b0110_1111_0000 | ||
0b01G 0b01L 0b01I | ||
0b01D 0b01F | ||
|
||
0xBABE | ||
0xBad_Face | ||
0x1.8p1 | ||
0xa.fp-2 | ||
|
||
42_000 | ||
3.14_15_9 | ||
1.2e3 | ||
3E+1 | ||
4E-2 | ||
42g 42l 42i | ||
42d 42f | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["number", "0b0110"], | ||
["number", "0b0110_1111_0000"], | ||
["number", "0b01G"], ["number", "0b01L"], ["number", "0b01I"], | ||
["number", "0b01D"], ["number", "0b01F"], | ||
|
||
["number", "0xBABE"], | ||
["number", "0xBad_Face"], | ||
["number", "0x1.8p1"], | ||
["number", "0xa.fp-2"], | ||
|
||
["number", "42_000"], | ||
["number", "3.14_15_9"], | ||
["number", "1.2e3"], | ||
["number", "3E+1"], | ||
["number", "4E-2"], | ||
["number", "42g"], ["number", "42l"], ["number", "42i"], | ||
["number", "42d"], ["number", "42f"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for binary, hexadecimal and decimal numbers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
~ | ||
= == =~ ==~ | ||
? ?. ?: | ||
* ** *. *= **= | ||
.@ .& | ||
5..8 | ||
5..<8 | ||
- -- -= -> | ||
+ ++ += | ||
! != | ||
< << <<= <= <=> | ||
> >> >>> >>= >>>= >= | ||
& && &= | ||
| || |= | ||
/ | ||
/= | ||
^ ^= | ||
% %= | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["operator", "~"], | ||
["operator", "="], ["operator", "=="], ["operator", "=~"], ["operator", "==~"], | ||
["operator", "?"], ["operator", "?."], ["operator", "?:"], | ||
["operator", "*"], ["operator", "**"], ["operator", "*."], ["operator", "*="], ["operator", "**="], | ||
["operator", ".@"], ["operator", ".&"], | ||
["number", "5"], ["operator", ".."], ["number", "8"], | ||
["number", "5"], ["operator", "..<"], ["number", "8"], | ||
["operator", "-"], ["operator", "--"], ["operator", "-="], ["operator", "->"], | ||
["operator", "+"], ["operator", "++"], ["operator", "+="], | ||
["operator", "!"], ["operator", "!="], | ||
["operator", "<"], ["operator", "<<"], ["operator", "<<="], ["operator", "<="], ["operator", "<=>"], | ||
["operator", ">"], ["operator", ">>"], ["operator", ">>>"], ["operator", ">>="], ["operator", ">>>="], ["operator", ">="], | ||
["operator", "&"], ["operator", "&&"], ["operator", "&="], | ||
["operator", "|"], ["operator", "||"], ["operator", "|="], | ||
["operator", "/"], | ||
["operator", "/="], | ||
["operator", "^"], ["operator", "^="], | ||
["operator", "%"], ["operator", "%="] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for all operators. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!foobar | ||
#!/usr/bin/env groovy | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["shebang", "#!foobar"], | ||
["shebang", "#!/usr/bin/env groovy"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Check for shebang comments. |
Oops, something went wrong.