Skip to content

Instantly share code, notes, and snippets.

View wangxi761's full-sized avatar

eryu-xiwang wangxi761

View GitHub Profile
@wangxi761
wangxi761 / source_unit_compilation.groovy
Created April 21, 2020 06:57 — forked from pffreitas/source_unit_compilation.groovy
Groovy source unit compilation and inspection.
import org.codehaus.groovy.control.SourceUnit
import static org.codehaus.groovy.control.Phases.*
import org.codehaus.groovy.control.CompilationUnit
import org.codehaus.groovy.control.CompilationFailedException
import groovy.json.JsonBuilder
def sourceUnit = SourceUnit.create("None", """
package bla.blow
import java.util.Date
package com.example.demo.gaia;
import com.jayway.jsonpath.JsonPath;
import javax.annotation.Resource;
public class LoginFlow extends AbstractFlow {
@Resource(name = "other")
AbstractFlow other_flow;