Hello,
I'm writing new Maven library - similar to this example
https://track.pmease.com/browse/QB-3503
I need QuickBuild Context during development, so I could mock QB API and also during runtime it could be resolved in script in QuickBuild
Let's present it on example:
In my IDEA:
--------------------------------------------------------------
It would be perfect to add Maven dependency into my Groovy/Java project like:
<dependency>
<groupId>com.pmease.quickbuild</groupId>
<artifactId>qb-context</artifactId>
<version>1.0</version>
</dependency>
FancyClass.java:
--------------------------------------------------------------
package example.for.robin
import com.pmease.quickbuild.Context
public class FancyClass {
Context qbContext;
FancyClass(Context context){
this.qbContext = context;
dummyVarGet("test");
}
void dummyVarGet(String varName){
String varValue = qbContext.vars.getValue(varName)
System.out.println(varValue);
}
}
--------------------------------------------------------------
So In QB script field I'd expect something like this:
--------------------------------------------------------------
groovy:
@Grab("example.for.robin:Tool:1.0")
import example.for.robin.FancyClass
QBContext context = QBContext.getContext() // Available in QB API
FancyClass fancyClass = new FancyClass(context)
--------------------------------------------------------------
Best Regards
Maciej