Skip to content

Commit 654e920

Browse files
aksOpsclaude
andcommitted
fix: read version from build-info.properties, rename OSSCodeIQ → Code IQ
VersionCommand: - Read version from Spring Boot BuildProperties (generated by build-info goal) - Fallback chain: BuildProperties → build-info.properties → MANIFEST.MF → "dev" - Remove hardcoded VERSION = "0.1.0-SNAPSHOT" - Keep static VERSION field for backward compat (used by Analyzer, EnrichCommand, BundleCommand) pom.xml: - Add spring-boot-maven-plugin build-info execution to generate build-info.properties Branding: - Rename OSSCodeIQ → Code IQ in all user-facing output, HTML templates, CLI headers, generated docs, and Javadoc comments (17 files) - Java class names and Maven coordinates unchanged Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4276f11 commit 654e920

20 files changed

Lines changed: 60 additions & 26 deletions

File tree

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@
188188
<configuration>
189189
<classifier>cli</classifier>
190190
</configuration>
191+
<executions>
192+
<execution>
193+
<goals>
194+
<goal>build-info</goal>
195+
</goals>
196+
</execution>
197+
</executions>
191198
</plugin>
192199

193200
<plugin>

src/main/frontend/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<meta name="theme-color" content="#0a0a1a" />
8-
<title>OSSCodeIQ</title>
8+
<title>Code IQ</title>
99
<link rel="preconnect" href="https://fonts.googleapis.com" />
1010
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1111
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />

src/main/frontend/tests/e2e/navigation.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test.describe('Layout shell', () => {
5959
});
6060

6161
test('logo and app title are visible', async ({ page }) => {
62-
await expect(page.getByText('OSSCodeIQ')).toBeVisible();
62+
await expect(page.getByText('Code IQ')).toBeVisible();
6363
});
6464
});
6565

src/main/java/io/github/randomcodespace/iq/CodeIqApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import java.util.Arrays;
1313

1414
/**
15-
* Main application entry point for OSSCodeIQ.
15+
* Main application entry point for Code IQ.
1616
* <p>
1717
* Uses Picocli with Spring Boot integration for CLI command routing.
1818
* Profile selection:

src/main/java/io/github/randomcodespace/iq/api/GraphController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import java.util.stream.Collectors;
2727

2828
/**
29-
* REST API controller matching the Python OSSCodeIQ API paths.
29+
* REST API controller matching the Python Code IQ API paths.
3030
*/
3131
@RestController
3232
@RequestMapping("/api")

src/main/java/io/github/randomcodespace/iq/cli/CodeIqCli.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import picocli.CommandLine.Command;
66

77
/**
8-
* Top-level CLI entry point for OSSCodeIQ.
8+
* Top-level CLI entry point for Code IQ.
99
* Delegates to subcommands for actual work.
1010
*/
1111
@Component

src/main/java/io/github/randomcodespace/iq/cli/PluginsCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ public FileVisitResult visitFileFailed(Path file, IOException exc) {
402402

403403
// Generate YAML config
404404
StringBuilder yaml = new StringBuilder();
405-
yaml.append("# Auto-generated OSSCodeIQ configuration\n");
405+
yaml.append("# Auto-generated Code IQ configuration\n");
406406
yaml.append("# Optimized for this project's detected languages\n\n");
407407

408408
yaml.append("languages:\n");
@@ -461,7 +461,7 @@ public Integer call() {
461461

462462
private int generateMarkdown() {
463463
var sb = new StringBuilder();
464-
sb.append("# OSSCodeIQ Detector Reference\n\n");
464+
sb.append("# Code IQ Detector Reference\n\n");
465465
sb.append("Total detectors: ").append(registry.count()).append("\n\n");
466466

467467
Map<String, List<Detector>> byCategory = registry.byCategory();

src/main/java/io/github/randomcodespace/iq/cli/StatsCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ int outputPretty(Map<String, Object> stats) {
141141
String projectName = path.toAbsolutePath().normalize().getFileName().toString();
142142

143143
out.println();
144-
CliOutput.print(out, "@|bold \uD83D\uDCCA OSSCodeIQ Stats \u2014 " + projectName + "|@");
144+
CliOutput.print(out, "@|bold \uD83D\uDCCA Code IQ Stats \u2014 " + projectName + "|@");
145145
out.println();
146146

147147
// Graph
@@ -278,7 +278,7 @@ int outputYaml(Map<String, Object> stats) {
278278
int outputMarkdown(Map<String, Object> stats) {
279279
NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US);
280280

281-
out.println("# OSSCodeIQ Stats");
281+
out.println("# Code IQ Stats");
282282
out.println();
283283

284284
if (stats.containsKey("graph")) {

src/main/java/io/github/randomcodespace/iq/cli/VersionCommand.java

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.github.randomcodespace.iq.cli;
22

33
import io.github.randomcodespace.iq.detector.DetectorRegistry;
4+
import org.springframework.boot.info.BuildProperties;
45
import org.springframework.stereotype.Component;
56
import picocli.CommandLine.Command;
67

@@ -16,22 +17,48 @@
1617
description = "Show version info")
1718
public class VersionCommand implements Callable<Integer> {
1819

19-
public static final String VERSION = "0.1.0-SNAPSHOT";
20+
/** Fallback version used when BuildProperties is unavailable (e.g. running from IDE). */
21+
public static final String VERSION = resolveVersion();
2022

2123
private final DetectorRegistry registry;
24+
private final BuildProperties buildProperties;
2225

23-
public VersionCommand(DetectorRegistry registry) {
26+
public VersionCommand(DetectorRegistry registry,
27+
@org.springframework.lang.Nullable BuildProperties buildProperties) {
2428
this.registry = registry;
29+
this.buildProperties = buildProperties;
30+
}
31+
32+
private static String resolveVersion() {
33+
// Try reading from build-info.properties on the classpath (generated by spring-boot-maven-plugin)
34+
try (var is = VersionCommand.class.getResourceAsStream("/META-INF/build-info.properties")) {
35+
if (is != null) {
36+
var props = new java.util.Properties();
37+
props.load(is);
38+
String v = props.getProperty("build.version");
39+
if (v != null && !v.isBlank()) return v;
40+
}
41+
} catch (Exception ignored) {
42+
// intentionally empty
43+
}
44+
// Fallback: Implementation-Version from JAR manifest
45+
String v = VersionCommand.class.getPackage().getImplementationVersion();
46+
return v != null ? v : "dev";
2547
}
2648

2749
@Override
2850
public Integer call() {
51+
// Prefer Spring BuildProperties (populated at runtime) over static resolution
52+
String version = buildProperties != null
53+
? buildProperties.getVersion()
54+
: VERSION;
55+
2956
Set<String> allLanguages = new TreeSet<>();
3057
for (var d : registry.allDetectors()) {
3158
allLanguages.addAll(d.getSupportedLanguages());
3259
}
3360

34-
CliOutput.bold("OSSCodeIQ " + VERSION);
61+
CliOutput.bold("Code IQ " + version);
3562
CliOutput.info(" Java: " + System.getProperty("java.version")
3663
+ " (" + System.getProperty("java.vendor") + ")");
3764
CliOutput.info(" Runtime: " + System.getProperty("java.runtime.name"));

src/main/java/io/github/randomcodespace/iq/config/CodeIqConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import java.util.Map;
2020

2121
/**
22-
* Configuration properties for OSSCodeIQ, bound to the "codeiq" prefix.
22+
* Configuration properties for Code IQ, bound to the "codeiq" prefix.
2323
*/
2424
@Configuration
2525
@ConfigurationProperties(prefix = "codeiq")

0 commit comments

Comments
 (0)