jamesnetherton commented on a change in pull request #957: Automatically
resolve dependencies for language expressions
URL: https://github.com/apache/camel-k/pull/957#discussion_r328496551
##########
File path: pkg/util/source/inspector.go
##########
@@ -35,13 +35,22 @@ var (
doubleQuotedTo =
regexp.MustCompile(`\.to\s*\(\s*"([a-zA-Z0-9-]+:[^"]+)"`)
doubleQuotedToD =
regexp.MustCompile(`\.toD\s*\(\s*"([a-zA-Z0-9-]+:[^"]+)"`)
doubleQuotedToF =
regexp.MustCompile(`\.toF\s*\(\s*"([a-zA-Z0-9-]+:[^"]+)"`)
+ languageRegexp =
regexp.MustCompile(`language\s*\(\s*["|']([a-zA-Z0-9-]+[^"|']+)["|']\s*,.*\)`)
additionalDependencies = map[string]string{
- `.*JsonLibrary\.Jackson.*`: "camel:jackson",
- `.*\.hystrix().*`: "camel:hystrix",
- `.*restConfiguration().*`: "camel:rest",
- `.*rest(("[a-zA-Z0-9-/]+")*).*`: "camel:rest",
- `^\s*rest\s*{.*`: "camel:rest",
+ `.*JsonLibrary\.Jackson.*`:
"camel:jackson",
+ `.*\.hystrix().*`:
"camel:hystrix",
+ `.*restConfiguration().*`: "camel:rest",
+ `.*rest(("[a-zA-Z0-9-/]+")*).*`: "camel:rest",
+ `^\s*rest\s*{.*`: "camel:rest",
+ `.*\.groovy\s*\(.*\).*`:
"camel:groovy",
+ `.*\.(jsonpath|jsonpathWriteAsString)\s*\(.*\).*`:
"camel:jsonpath",
+ `.*\.ognl\s*\(.*\).*`: "camel:ognl",
+ `.*\.mvel\s*\(.*\).*`: "camel:mvel",
+ `.*\.?simple\s*\(.*\).*`: "camel:bean",
+ `.*\.xquery\s*\(.*\).*`:
"camel:saxon",
+ `.*\.xpath\s*\(.*\).*`:
"camel:xpath",
Review comment:
Thanks, I pushed a fix + test for that.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services