def isolatedDirectory = System.getenv('FMODE_JPUSH_TEST_BUILD_DIR') if (!isolatedDirectory) { throw new GradleException('FMODE_JPUSH_TEST_BUILD_DIR is required for isolated compilation') } gradle.beforeProject { target -> if (target.path == ':app') { target.layout.buildDirectory.set(new File(isolatedDirectory)) } }