groovy

How to output deprecation warnings for Kotlin code?

与世无争的帅哥 提交于 2020-05-31 07:34:14
问题 I am using the following configuration snippet in my Java/Kotlin Android project in the app/build.gradle file: gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" } } It generates a verbose output of Lint warnings in .java files when the project is compiled. I would like to achieve the same for .kt files. I found out that Kotlin has compiler options: gradle.projectsEvaluated { tasks.withType(org.jetbrains.kotlin.gradle

Multipart file upload - maxFileSize exceeded

狂风中的少年 提交于 2020-05-28 07:26:29
问题 I try to upload a file with a size greater than 128kb but I always get (Grails 4) org.apache.tomcat.util.http.fileupload.impl.SizeLimitExceededException: the request was rejected because its size (1474589) exceeds the configured maximum (128000) I already tried: my application.yml: controllers: defaultScope: singleton upload: maxFileSize: 26214400 maxRequestSize: 26214400‬ My CustomMultipartResolver: class CustomMultipartResolver extends StandardServletMultipartResolver { static final String

regex over multiple lines in Groovy

孤街醉人 提交于 2020-05-24 21:04:43
问题 I have a multiple line string like following: END IF; EXECUTE IMMEDIATE ' CREATE INDEX #idx1 ON somename ( row_id, something)'; IF v_sys_error 0 THEN GOTO SQL_ERROR; END IF; I wish to capture the part in bold (meaning everything from EXECUTE IMMEDIATE to next semicolon. I have the following regex but how can I change it to work with multiple lines? (EXECUTE).*; 回答1: (?m) makes the regex multiline - allows you to match beginning (^) and end ($) of string operators (in this case, to match the

can not create file via Groovy code(or java code) in jenkinsfile of a pipeline job on Jenkins

被刻印的时光 ゝ 提交于 2020-05-23 10:07:28
问题 pipeline { agent any stages { stage('Build') { steps { echo 'Building..' echo "whoami".execute().text script { File f = new File('/home/jenkins/test2.txt'); f.createNewFile(); } } } stage('Test') { steps { echo 'Testing..' } } stage('Deploy') { steps { echo 'Deploying....' } } } } Jenkins console log: (got exception: Started by user Edgar Yu Running in Durability level: MAX_SURVIVABILITY [Pipeline] node Running on Jenkins in /var/jenkins_home/workspace/test2 [Pipeline] { [Pipeline] stage

How to do a POST web api call with groovy code?

﹥>﹥吖頭↗ 提交于 2020-05-17 06:07:06
问题 I have some POST method url, 2 headers to pass and a big body in Json format, that I need to call through the Groovy code. But I am not sure on points like how to pass headers and big Json object in Groovy code for API call. Please help me on thease points. I am writin this code in visual code. Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.1' ) import groovyx.net.http.* import static groovyx.net.http.ContentType.* import static groovyx.net.http

How to do a POST web api call with groovy code?

て烟熏妆下的殇ゞ 提交于 2020-05-17 06:04:09
问题 I have some POST method url, 2 headers to pass and a big body in Json format, that I need to call through the Groovy code. But I am not sure on points like how to pass headers and big Json object in Groovy code for API call. Please help me on thease points. I am writin this code in visual code. Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.1' ) import groovyx.net.http.* import static groovyx.net.http.ContentType.* import static groovyx.net.http

Spock Unroll seems to print something odd with boolean parameter

风格不统一 提交于 2020-05-17 05:49:09
问题 I just put this test method together: @Unroll def 'super start edit should be called if cell is not empty'( boolean empty ){ given: DueDateEditor editor = GroovySpy( DueDateEditor ){ isEmpty() >> empty } when: editor.startEdit() then: if( empty){ 0 * editor.callSuperStartEdit() } else { 1 * editor.callSuperStartEdit() } where: empty | _ true | _ false | _ } ... it works OK in terms of the two tests passing... but when you make it fail it's very odd: the output if the parameter empty is false

How to define array in Groovy soapUI?

让人想犯罪 __ 提交于 2020-05-16 05:16:43
问题 I am working in soapUI. I need to define Array in Groovy in soapUI groovy script. Could you please help me 回答1: // Define the array def MAX_SIZE = 4 def myArray = new Object[MAX_SIZE] // Fill the array myArray[0] = "This" myArray[1] = "is" myArray[2] = "my" myArray[3] = "array." // Print content of the array myArray.each { log.info(it) } 回答2: See here, for example: http://groovy.codehaus.org/JN1025-Arrays 来源: https://stackoverflow.com/questions/8968028/how-to-define-array-in-groovy-soapui

How to define array in Groovy soapUI?

我怕爱的太早我们不能终老 提交于 2020-05-16 05:16:25
问题 I am working in soapUI. I need to define Array in Groovy in soapUI groovy script. Could you please help me 回答1: // Define the array def MAX_SIZE = 4 def myArray = new Object[MAX_SIZE] // Fill the array myArray[0] = "This" myArray[1] = "is" myArray[2] = "my" myArray[3] = "array." // Print content of the array myArray.each { log.info(it) } 回答2: See here, for example: http://groovy.codehaus.org/JN1025-Arrays 来源: https://stackoverflow.com/questions/8968028/how-to-define-array-in-groovy-soapui

Groovy collect from map and submap

与世无争的帅哥 提交于 2020-05-16 03:54:31
问题 I had a requirement to convert a JSON response into a csv file. I was able to successfully use Tim Yates' excellent code from here: Groovy code to convert json to CSV file I now need to include the JSON's nested submap in the csv as well. The relationship between the map and submap is 1:1. I've been unable to get the correct syntax for a collect statement that will retrieve both the parsed map and submap key/values. Sample JSON {items= [ { created_at=2019-03-27 , entity_id=1 , extension