Skip to content

Commit 3e32998

Browse files
authored
Merge pull request #1 from Archway-Labs-AI/add/sonar-ty-runners
target_tools: add sonar (Java/Maven) and ty (Astral) runners
2 parents 3719de1 + ea13026 commit 3e32998

11 files changed

Lines changed: 1244 additions & 0 deletions

File tree

src/runner_class.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,40 @@ def __init__(
320320
)
321321

322322

323+
class SonarRunner(TypeEvalPyRunner):
324+
def __init__(
325+
self,
326+
host_results_path,
327+
debug=False,
328+
nocache=False,
329+
custom_benchmark_dir=None,
330+
):
331+
super().__init__(
332+
"sonar",
333+
"./target_tools/sonar",
334+
host_results_path,
335+
nocache=nocache,
336+
custom_benchmark_dir=custom_benchmark_dir,
337+
)
338+
339+
340+
class TyRunner(TypeEvalPyRunner):
341+
def __init__(
342+
self,
343+
host_results_path,
344+
debug=False,
345+
nocache=False,
346+
custom_benchmark_dir=None,
347+
):
348+
super().__init__(
349+
"ty",
350+
"./target_tools/ty",
351+
host_results_path,
352+
nocache=nocache,
353+
custom_benchmark_dir=custom_benchmark_dir,
354+
)
355+
356+
323357
class Type4pyRunner(TypeEvalPyRunner):
324358
def __init__(
325359
self,

src/target_tools/sonar/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM maven:3.9-eclipse-temurin-17 AS build
2+
WORKDIR /build
3+
COPY harness/pom.xml ./pom.xml
4+
RUN mvn -B -q dependency:go-offline || true
5+
COPY harness/src ./src
6+
RUN mvn -B -q -DskipTests package
7+
8+
FROM eclipse-temurin:17-jre-noble
9+
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
10+
RUN apt-get update \
11+
&& apt-get install -y --no-install-recommends python3 python3-pip ca-certificates \
12+
&& ln -sf /usr/bin/python3 /usr/bin/python \
13+
&& rm -rf /var/lib/apt/lists/*
14+
WORKDIR /app
15+
COPY --from=build /build/target/sonar-typeeval-runner.jar /app/sonar-typeeval-runner.jar
16+
COPY src /tmp/src
17+
CMD ["bash"]
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>com.archway</groupId>
6+
<artifactId>sonar-typeeval-runner</artifactId>
7+
<version>0.1.0</version>
8+
<packaging>jar</packaging>
9+
10+
<properties>
11+
<maven.compiler.source>17</maven.compiler.source>
12+
<maven.compiler.target>17</maven.compiler.target>
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
<sonar-python.version>5.23.0.33560</sonar-python.version>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.sonarsource.python</groupId>
20+
<artifactId>python-frontend</artifactId>
21+
<version>${sonar-python.version}</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>com.google.code.gson</groupId>
25+
<artifactId>gson</artifactId>
26+
<version>2.10.1</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.slf4j</groupId>
30+
<artifactId>slf4j-api</artifactId>
31+
<version>2.0.13</version>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.slf4j</groupId>
35+
<artifactId>slf4j-simple</artifactId>
36+
<version>2.0.13</version>
37+
</dependency>
38+
</dependencies>
39+
40+
<build>
41+
<finalName>sonar-typeeval-runner</finalName>
42+
<plugins>
43+
<plugin>
44+
<groupId>org.apache.maven.plugins</groupId>
45+
<artifactId>maven-shade-plugin</artifactId>
46+
<version>3.5.1</version>
47+
<executions>
48+
<execution>
49+
<phase>package</phase>
50+
<goals><goal>shade</goal></goals>
51+
<configuration>
52+
<createDependencyReducedPom>false</createDependencyReducedPom>
53+
<transformers>
54+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
55+
<mainClass>com.archway.sonarrunner.SonarTypeEvalRunner</mainClass>
56+
</transformer>
57+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
58+
</transformers>
59+
<filters>
60+
<filter>
61+
<artifact>*:*</artifact>
62+
<excludes>
63+
<exclude>META-INF/*.SF</exclude>
64+
<exclude>META-INF/*.DSA</exclude>
65+
<exclude>META-INF/*.RSA</exclude>
66+
</excludes>
67+
</filter>
68+
</filters>
69+
</configuration>
70+
</execution>
71+
</executions>
72+
</plugin>
73+
</plugins>
74+
</build>
75+
</project>

0 commit comments

Comments
 (0)