Skip to content

Commit

Permalink
Merge pull request #1 from PragatiSukhija/feature-nullaway
Browse files Browse the repository at this point in the history
Added necessary plugins and updated build command
  • Loading branch information
PragatiSukhija authored Oct 12, 2024
2 parents ebe490d + d4ae298 commit a3eea34
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 4 deletions.
2 changes: 2 additions & 0 deletions compiler/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ FROM maven:3.9.4-amazoncorretto-21-al2023 AS dependencies
COPY pom.xml pom.xml

RUN mvn dependency:copy-dependencies
RUN mvn org.apache.maven.plugins:maven-dependency-plugin:3.2.0:copy@copy-plugin-dependencies


FROM ubuntu:20.04 as jre
Expand Down Expand Up @@ -39,6 +40,7 @@ RUN /playground/attach_notice.sh /playground/security_notice.txt /etc/passwd &&
rm -f /playground/attach_notice.sh

COPY --chown=playground --from=dependencies target/dependency /playground/dependencies
COPY --chown=playground --from=dependencies target/plugins /playground/plugins
COPY --chown=playground --from=jre jre /playground/jre

USER playground
Expand Down
54 changes: 54 additions & 0 deletions compiler/base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,58 @@
</dependency>

</dependencies>

<build>
<plugins>
<!-- Maven Compiler Plugin for NullAway and Error Prone -->

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-plugin-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/plugins</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.32.0</version>
<classifier>with-dependencies</classifier>
</artifactItem>
<artifactItem>
<groupId>io.github.eisop</groupId>
<artifactId>dataflow-errorprone</artifactId>
<version>3.42.0-eisop4</version>
</artifactItem>
<artifactItem>
<groupId>com.uber.nullaway</groupId>
<artifactId>nullaway</artifactId>
<version>0.10.25</version>
</artifactItem>
<artifactItem>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<version>3.9.1</version>
</artifactItem>
<artifactItem>
<groupId>org.checkerframework</groupId>
<artifactId>dataflow-nullaway</artifactId>
<version>3.47.0</version>
</artifactItem>

</artifactItems>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>
8 changes: 4 additions & 4 deletions ui/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1978,10 +1978,10 @@
resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d"
integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==

ace-builds@^1.23.0:
version "1.23.1"
resolved "https://registry.yarnpkg.com/ace-builds/-/ace-builds-1.23.1.tgz#2a1a2c2717c21cfd102f641552cf371ab6bce6e4"
integrity sha512-vmLfsfOOvEiQPri2Vz+76FvUalz/nHB7+X2GqonG7rc2V+WrHvqc4xYowt1+fxHH3aWw/pDF2jqKQrd8JNMmiQ==
ace-builds@^1.32.7:
version "1.36.2"
resolved "https://registry.yarnpkg.com/ace-builds/-/ace-builds-1.36.2.tgz#9499bd59e839a335ac4850e74549ca8d849dc554"
integrity sha512-eqqfbGwx/GKjM/EnFu4QtQ+d2NNBu84MGgxoG8R5iyFpcVeQ4p9YlTL+ZzdEJqhdkASqoqOxCSNNGyB6lvMm+A==

acorn-import-assertions@^1.9.0:
version "1.9.0"
Expand Down
18 changes: 18 additions & 0 deletions ui/src/sandbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,24 @@ fn build_execution_command(
cmd.push("--enable-preview".to_string());
}

//Added for Error-prone integration
cmd.extend([
"-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED".to_string(),
"-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED".to_string(),
"-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED".to_string(),
"-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED".to_string(),
"-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED".to_string(),
"-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED".to_string(),
"-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED".to_string(),
"-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED".to_string(),
"-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED".to_string(),
"-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED".to_string(),
"-XDcompilePolicy=simple".to_string(),
"-processorpath".to_string(),
"plugins/error_prone_core-2.32.0-with-dependencies.jar:plugins/dataflow-errorprone-3.42.0-eisop4.jar:plugins/nullaway-0.10.25.jar:plugins/jspecify-1.0.0.jar:plugins/dataflow-nullaway-3.47.0.jar:plugins/checker-qual-3.9.1.jar:plugins/jsr305-3.0.2.jar".to_string(),
"-Xplugin:ErrorProne -Xep:NullAway:ERROR -XepOpt:NullAway:AnnotatedPackages=com.example".to_string()
]);

cmd.push("Main.java".to_string());
}

Expand Down

0 comments on commit a3eea34

Please sign in to comment.