I want to read few properties from a static java class file as below
class MyClass {
public static final class MyStaticClass {
public static final String PROPERTY_A = "myStringA";
public static final String PROPERTY_B = "myStringB";
}
}
This would be in MyClass.java file under
src/main/java/myProject/
I need to read PROPERTY_A
, and PROPERTY_B
in my app build.gradle inside android{} block.
Note that these need to be read from java file for a specific reason, and are not general properties. Hence, I am not reading them from gradle.properties
files.
I went through How do I call a static Java method from Gradle
but the article wasn't super clear.
I also tried gradle docs, but couldn't find a super clear answer.
I am bit new to groovy, so any suggestions here would be super helpful.
Thanks!