1

I have React Native Android project with jsonschema2pojo Gradle plugin in root project and in subproject too (located in cd ../node_modules/subproject) with different jsonSchema2Pojo configuration

dependencies {
    compile project(':subproject')
}

My Android Subproject is standard React Native module library located in ../node_modules. If I run 'gradlew build' on the root project in subproject Java classes is not generated only in root project. To generate Java classes in subproject I needs to navigate to subproject directory first:

cd ../node_modules/subproject/android
./gradlew generateJsonSchema2PojoForDebug

can I run the subproject generateJsonSchema2PojoForDebug task with the root build ?

sytolk
  • 7,223
  • 3
  • 25
  • 38

1 Answers1

0

the problem was that I have source = files("$rootDir/../json_model") and when the library is installed in node_modules source cannot be found from plugin. This fix the issue:

jsonSchema2Pojo {
    // Location of the JSON Schema file(s). This may refer to a single file or a directory of files.
    source = files("$projectDir/../json_model")
}
sytolk
  • 7,223
  • 3
  • 25
  • 38