Skip to content

Commit ed6afc0

Browse files
Merge pull request #1960 from codeflash-ai/chore/bump-java-runtime-1.0.1
chore: bump codeflash-java-runtime to 1.0.1
2 parents 15a9261 + d5d69b4 commit ed6afc0

8 files changed

Lines changed: 29 additions & 29 deletions

File tree

code_to_optimize/java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<dependency>
4343
<groupId>com.codeflash</groupId>
4444
<artifactId>codeflash-runtime</artifactId>
45-
<version>1.0.0</version>
45+
<version>1.0.1</version>
4646
<scope>test</scope>
4747
</dependency>
4848
</dependencies>

codeflash-java-runtime/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<groupId>com.codeflash</groupId>
99
<artifactId>codeflash-runtime</artifactId>
10-
<version>1.0.0</version>
10+
<version>1.0.1</version>
1111
<packaging>jar</packaging>
1212

1313
<name>CodeFlash Java Runtime</name>

codeflash/languages/java/build_tool_strategy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
logger = logging.getLogger(__name__)
2323

24-
_RUNTIME_JAR_NAME = "codeflash-runtime-1.0.0.jar"
24+
_RUNTIME_JAR_NAME = "codeflash-runtime-1.0.1.jar"
2525
_JAVA_RUNTIME_DIR = Path(__file__).parent.parent.parent.parent / "codeflash-java-runtime"
2626

2727

codeflash/languages/java/build_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
logger = logging.getLogger(__name__)
1616

17-
CODEFLASH_RUNTIME_VERSION = "1.0.0"
17+
CODEFLASH_RUNTIME_VERSION = "1.0.1"
1818
CODEFLASH_RUNTIME_JAR_NAME = f"codeflash-runtime-{CODEFLASH_RUNTIME_VERSION}.jar"
1919

2020
JACOCO_PLUGIN_VERSION = "0.8.13"

codeflash/languages/java/gradle_strategy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def ensure_runtime(self, build_root: Path, test_module: str | None) -> bool:
432432

433433
libs_dir = module_root / "libs"
434434
libs_dir.mkdir(parents=True, exist_ok=True)
435-
dest_jar = libs_dir / "codeflash-runtime-1.0.0.jar"
435+
dest_jar = libs_dir / "codeflash-runtime-1.0.1.jar"
436436

437437
if not dest_jar.exists():
438438
logger.info("Copying codeflash-runtime JAR to %s", dest_jar)

codeflash/languages/java/maven_strategy.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@
6262

6363
CODEFLASH_CACHE_DIR = Path.home() / ".cache" / "codeflash"
6464

65-
CODEFLASH_DEPENDENCY_SNIPPET = """\
65+
CODEFLASH_DEPENDENCY_SNIPPET = f"""\
6666
<dependency>
6767
<groupId>com.codeflash</groupId>
6868
<artifactId>codeflash-runtime</artifactId>
69-
<version>1.0.0</version>
69+
<version>{CODEFLASH_RUNTIME_VERSION}</version>
7070
<scope>test</scope>
7171
</dependency>
7272
</dependencies>"""
@@ -140,7 +140,7 @@ def install_codeflash_runtime(project_root: Path, runtime_jar_path: Path, mvn: s
140140
f"-Dfile={runtime_jar_path}",
141141
"-DgroupId=com.codeflash",
142142
"-DartifactId=codeflash-runtime",
143-
"-Dversion=1.0.0",
143+
f"-Dversion={CODEFLASH_RUNTIME_VERSION}",
144144
"-Dpackaging=jar",
145145
"-B",
146146
]
@@ -288,26 +288,26 @@ def add_codeflash_dependency(pom_path: Path) -> bool:
288288
content = pom_path.read_text(encoding="utf-8")
289289

290290
if "codeflash-runtime" in content:
291-
if "<scope>system</scope>" in content:
292-
293-
def replace_system_dep(match: re.Match[str]) -> str:
294-
block: str = match.group(0)
295-
if "codeflash-runtime" in block and "<scope>system</scope>" in block:
296-
return (
297-
"<dependency>\n"
298-
" <groupId>com.codeflash</groupId>\n"
299-
" <artifactId>codeflash-runtime</artifactId>\n"
300-
" <version>1.0.0</version>\n"
301-
" <scope>test</scope>\n"
302-
" </dependency>"
303-
)
291+
292+
def update_codeflash_dep(match: re.Match[str]) -> str:
293+
block: str = match.group(0)
294+
if "codeflash-runtime" not in block:
304295
return block
296+
return (
297+
"<dependency>\n"
298+
" <groupId>com.codeflash</groupId>\n"
299+
" <artifactId>codeflash-runtime</artifactId>\n"
300+
f" <version>{CODEFLASH_RUNTIME_VERSION}</version>\n"
301+
" <scope>test</scope>\n"
302+
" </dependency>"
303+
)
305304

306-
content = re.sub(r"<dependency>[\s\S]*?</dependency>", replace_system_dep, content)
307-
pom_path.write_text(content, encoding="utf-8")
308-
logger.info("Replaced system-scope codeflash-runtime dependency with test scope")
309-
return True
310-
logger.info("codeflash-runtime dependency already present in pom.xml")
305+
updated = re.sub(r"<dependency>[\s\S]*?</dependency>", update_codeflash_dep, content)
306+
if updated != content:
307+
pom_path.write_text(updated, encoding="utf-8")
308+
logger.info("Updated codeflash-runtime dependency to version %s in pom.xml", CODEFLASH_RUNTIME_VERSION)
309+
else:
310+
logger.info("codeflash-runtime dependency already up to date in pom.xml")
311311
return True
312312

313313
closing_tag = "</dependencies>"
@@ -571,8 +571,8 @@ class MavenStrategy(BuildToolStrategy):
571571
/ "com"
572572
/ "codeflash"
573573
/ "codeflash-runtime"
574-
/ "1.0.0"
575-
/ "codeflash-runtime-1.0.0.jar"
574+
/ "1.0.1"
575+
/ "codeflash-runtime-1.0.1.jar"
576576
)
577577

578578
@property
-15.2 MB
Binary file not shown.

tests/test_languages/fixtures/java_tracer_e2e/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<dependency>
2424
<groupId>com.codeflash</groupId>
2525
<artifactId>codeflash-runtime</artifactId>
26-
<version>1.0.0</version>
26+
<version>1.0.1</version>
2727
<scope>test</scope>
2828
</dependency>
2929
</dependencies>

0 commit comments

Comments
 (0)