@@ -104,17 +104,19 @@ CoreTestHelper exitProjectConstruction() {
104
104
* which will be passed through gradle command line arguments.
105
105
*
106
106
* @param outDirPath Path to serialization output directory,
107
+ * @param jSpecifyModeEnabled Flag to enable jSpecify mode when running NullAway.
107
108
* @return The command to build the project including the command line arguments, this command can
108
109
* * be executed from any directory.
109
110
*/
110
- public String computeTargetBuildCommand (Path outDirPath ) {
111
+ public String computeTargetBuildCommand (Path outDirPath , boolean jSpecifyModeEnabled ) {
111
112
return String .format (
112
- "%s && ./gradlew %s %s -Plibrary-model-loader-path=%s --rerun-tasks" ,
113
+ "%s && ./gradlew %s %s -Plibrary-model-loader-path=%s -Pjspecify=%s - -rerun-tasks" ,
113
114
Utility .changeDirCommand (pathToProject ),
114
115
computeCompileGradleCommandForModules (modules .subList (0 , 1 )),
115
116
String .join (" " , Utility .computeConfigPathsWithGradleArguments (outDirPath , modules )),
116
117
Utility .getPathToLibraryModel (outDirPath )
117
- .resolve (Paths .get ("build" , "libs" , "librarymodel.jar" )));
118
+ .resolve (Paths .get ("build" , "libs" , "librarymodel.jar" )),
119
+ jSpecifyModeEnabled );
118
120
}
119
121
120
122
/**
@@ -124,18 +126,21 @@ public String computeTargetBuildCommand(Path outDirPath) {
124
126
* line arguments.
125
127
*
126
128
* @param outDirPath Path to serialization output directory,
129
+ * @param jSpecifyModeEnabled Flag to enable jSpecify mode when running NullAway.
127
130
* @return The command to build the project including the command line arguments, this command can
128
131
* * be executed from any directory.
129
132
*/
130
- public String computeTargetBuildCommandWithLibraryModelLoaderDependency (Path outDirPath ) {
133
+ public String computeTargetBuildCommandWithLibraryModelLoaderDependency (
134
+ Path outDirPath , boolean jSpecifyModeEnabled ) {
131
135
return String .format (
132
- "%s && ./gradlew library-model-loader:jar --rerun-tasks && %s && ./gradlew %s %s -Plibrary-model-loader-path=%s --rerun-tasks" ,
136
+ "%s && ./gradlew library-model-loader:jar --rerun-tasks && %s && ./gradlew %s %s -Plibrary-model-loader-path=%s -Pjspecify=%s - -rerun-tasks" ,
133
137
Utility .changeDirCommand (outDirPath .resolve ("Annotator" )),
134
138
Utility .changeDirCommand (pathToProject ),
135
139
computeCompileGradleCommandForModules (modules .subList (0 , 1 )),
136
140
String .join (" " , Utility .computeConfigPathsWithGradleArguments (outDirPath , modules )),
137
141
Utility .getPathToLibraryModel (outDirPath )
138
- .resolve (Paths .get ("build" , "libs" , "librarymodel.jar" )));
142
+ .resolve (Paths .get ("build" , "libs" , "librarymodel.jar" )),
143
+ jSpecifyModeEnabled );
139
144
}
140
145
141
146
/**
@@ -145,19 +150,21 @@ public String computeTargetBuildCommandWithLibraryModelLoaderDependency(Path out
145
150
* line arguments.
146
151
*
147
152
* @param outDirPath Path to serialization output directory,
153
+ * @param jSpecifyModeEnabled Flag to enable jSpecify mode when running NullAway.
148
154
* @return The command to build the project including the command line arguments, this command can
149
155
* * be executed from any directory.
150
156
*/
151
157
public String computeDownstreamDependencyBuildCommandWithLibraryModelLoaderDependency (
152
- Path outDirPath ) {
158
+ Path outDirPath , boolean jSpecifyModeEnabled ) {
153
159
return String .format (
154
- "%s && ./gradlew library-model-loader:jar --rerun-tasks && %s && ./gradlew %s %s -Plibrary-model-loader-path=%s --rerun-tasks" ,
160
+ "%s && ./gradlew library-model-loader:jar --rerun-tasks && %s && ./gradlew %s %s -Plibrary-model-loader-path=%s -Pjspecify=%s - -rerun-tasks" ,
155
161
Utility .changeDirCommand (outDirPath .resolve ("Annotator" )),
156
162
Utility .changeDirCommand (pathToProject ),
157
163
computeCompileGradleCommandForModules (modules .subList (1 , modules .size ())),
158
164
String .join (" " , Utility .computeConfigPathsWithGradleArguments (outDirPath , modules )),
159
165
Utility .getPathToLibraryModel (outDirPath )
160
- .resolve (Paths .get ("build" , "libs" , "librarymodel.jar" )));
166
+ .resolve (Paths .get ("build" , "libs" , "librarymodel.jar" )),
167
+ jSpecifyModeEnabled );
161
168
}
162
169
163
170
/**
0 commit comments