Skip to content

Commit e17fc49

Browse files
committed
Rename remaining rome stuff to biome.
1 parent e10f397 commit e17fc49

File tree

17 files changed

+117
-118
lines changed

17 files changed

+117
-118
lines changed

lib/src/main/java/com/diffplug/spotless/rome/Architecture.java renamed to lib/src/main/java/com/diffplug/spotless/biome/Architecture.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2024 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package com.diffplug.spotless.rome;
16+
package com.diffplug.spotless.biome;
1717

1818
/**
1919
* Enumeration of possible computer architectures.
@@ -34,11 +34,11 @@ public static Architecture guess() {
3434
var version = System.getProperty("os.version");
3535

3636
if (arch == null || arch.isBlank()) {
37-
throw new IllegalStateException("No OS information is available, specify the Rome executable manually");
37+
throw new IllegalStateException("No OS information is available, specify the Biome executable manually");
3838
}
3939

4040
var msg = "Unsupported architecture " + arch + "/" + version
41-
+ ", specify the path to the Rome executable manually";
41+
+ ", specify the path to the Biome executable manually";
4242

4343
if (arch.equals("ppc64le")) {
4444
throw new IllegalStateException(msg);

lib/src/main/java/com/diffplug/spotless/rome/RomeExecutableDownloader.java renamed to lib/src/main/java/com/diffplug/spotless/biome/BiomeExecutableDownloader.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2024 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package com.diffplug.spotless.rome;
16+
package com.diffplug.spotless.biome;
1717

1818
import java.io.IOException;
1919
import java.math.BigInteger;
@@ -41,8 +41,8 @@
4141
* Downloader for the Biome executable:
4242
* <a href="https://github.com/biomejs/biome">https://github.com/biomejs/biome</a>.
4343
*/
44-
final class RomeExecutableDownloader {
45-
private static final Logger logger = LoggerFactory.getLogger(RomeExecutableDownloader.class);
44+
final class BiomeExecutableDownloader {
45+
private static final Logger logger = LoggerFactory.getLogger(BiomeExecutableDownloader.class);
4646

4747
/**
4848
* The checksum algorithm to use for checking the integrity of downloaded files.
@@ -80,7 +80,7 @@ final class RomeExecutableDownloader {
8080
* @param flavor Flavor of Biome to use.
8181
* @param downloadDir Directory where to store the downloaded executable.
8282
*/
83-
public RomeExecutableDownloader(BiomeFlavor flavor, Path downloadDir) {
83+
public BiomeExecutableDownloader(BiomeFlavor flavor, Path downloadDir) {
8484
this.flavor = flavor;
8585
this.downloadDir = downloadDir;
8686
}

lib/src/main/java/com/diffplug/spotless/rome/BiomeFlavor.java renamed to lib/src/main/java/com/diffplug/spotless/biome/BiomeFlavor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package com.diffplug.spotless.rome;
16+
package com.diffplug.spotless.biome;
1717

1818
/**
1919
* The flavor of Biome to use. Exists for compatibility reason, may be removed

lib/src/main/java/com/diffplug/spotless/rome/RomeStep.java renamed to lib/src/main/java/com/diffplug/spotless/biome/BiomeStep.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package com.diffplug.spotless.rome;
16+
package com.diffplug.spotless.biome;
1717

1818
import java.io.File;
1919
import java.io.IOException;
@@ -40,11 +40,11 @@
4040
/**
4141
* formatter step that formats JavaScript and TypeScript code with Biome:
4242
* <a href= "https://github.com/biomejs/biome">https://github.com/biomejs/biome</a>.
43-
* It delegates to the Biome executable. The Rome executable is downloaded from
43+
* It delegates to the Biome executable. The Biome executable is downloaded from
4444
* the network when no executable path is provided explicitly.
4545
*/
46-
public class RomeStep {
47-
private static final Logger logger = LoggerFactory.getLogger(RomeStep.class);
46+
public class BiomeStep {
47+
private static final Logger logger = LoggerFactory.getLogger(BiomeStep.class);
4848

4949
/**
5050
* Path to the directory with the {@code biome.json} config file, can be
@@ -113,8 +113,8 @@ public String name() {
113113
* @param downloadDir Directory where to place the downloaded executable.
114114
* @return A new Biome step that download the executable from the network.
115115
*/
116-
public static RomeStep withExeDownload(BiomeFlavor flavor, String version, String downloadDir) {
117-
return new RomeStep(flavor, version, null, downloadDir);
116+
public static BiomeStep withExeDownload(BiomeFlavor flavor, String version, String downloadDir) {
117+
return new BiomeStep(flavor, version, null, downloadDir);
118118
}
119119

120120
/**
@@ -125,8 +125,8 @@ public static RomeStep withExeDownload(BiomeFlavor flavor, String version, Strin
125125
* @param pathToExe Path to the Biome executable to use.
126126
* @return A new Biome step that format with the given executable.
127127
*/
128-
public static RomeStep withExePath(BiomeFlavor flavor, String pathToExe) {
129-
return new RomeStep(flavor, null, pathToExe, null);
128+
public static BiomeStep withExePath(BiomeFlavor flavor, String pathToExe) {
129+
return new BiomeStep(flavor, null, pathToExe, null);
130130
}
131131

132132
/**
@@ -230,7 +230,7 @@ private static void validateBiomeExecutable(String resolvedPathToExe) {
230230
* @param pathToExe Path to the Biome executable to use.
231231
* @param downloadDir Directory where to place the downloaded executable.
232232
*/
233-
private RomeStep(BiomeFlavor flavor, String version, String pathToExe, String downloadDir) {
233+
private BiomeStep(BiomeFlavor flavor, String version, String pathToExe, String downloadDir) {
234234
this.flavor = flavor;
235235
this.version = version != null && !version.isBlank() ? version : defaultVersion(flavor);
236236
this.pathToExe = pathToExe;
@@ -255,7 +255,7 @@ public FormatterStep create() {
255255
* a file named {@code biome.json}.
256256
* @return This builder instance for chaining method calls.
257257
*/
258-
public RomeStep withConfigPath(String configPath) {
258+
public BiomeStep withConfigPath(String configPath) {
259259
this.configPath = configPath;
260260
return this;
261261
}
@@ -280,7 +280,7 @@ public RomeStep withConfigPath(String configPath) {
280280
* @param language The language of the files to format.
281281
* @return This builder instance for chaining method calls.
282282
*/
283-
public RomeStep withLanguage(String language) {
283+
public BiomeStep withLanguage(String language) {
284284
this.language = language;
285285
return this;
286286
}
@@ -333,7 +333,7 @@ private String resolveExe() throws IOException, InterruptedException {
333333
return pathToExe;
334334
}
335335
} else {
336-
var downloader = new RomeExecutableDownloader(flavor, Paths.get(downloadDir));
336+
var downloader = new BiomeExecutableDownloader(flavor, Paths.get(downloadDir));
337337
var downloaded = downloader.ensureDownloaded(version).toString();
338338
makeExecutable(downloaded);
339339
return downloaded;

lib/src/main/java/com/diffplug/spotless/rome/OS.java renamed to lib/src/main/java/com/diffplug/spotless/biome/OS.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2024 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package com.diffplug.spotless.rome;
16+
package com.diffplug.spotless.biome;
1717

1818
import java.util.Locale;
1919

@@ -38,12 +38,12 @@ enum OS {
3838
public static OS guess() {
3939
var osName = System.getProperty("os.name");
4040
if (osName == null || osName.isBlank()) {
41-
throw new IllegalStateException("No OS information is available, specify the Rome executable manually");
41+
throw new IllegalStateException("No OS information is available, specify the Biome executable manually");
4242
}
4343
var osNameUpper = osName.toUpperCase(Locale.ROOT);
4444
if (osNameUpper.contains("SUNOS") || osName.contains("AIX")) {
4545
throw new IllegalStateException(
46-
"Unsupported OS " + osName + ", specify the path to the Rome executable manually");
46+
"Unsupported OS " + osName + ", specify the path to the Biome executable manually");
4747
}
4848
if (osNameUpper.contains("WINDOWS")) {
4949
return OS.WINDOWS;

lib/src/main/java/com/diffplug/spotless/rome/Platform.java renamed to lib/src/main/java/com/diffplug/spotless/biome/Platform.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2024 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package com.diffplug.spotless.rome;
16+
package com.diffplug.spotless.biome;
1717

1818
/**
1919
* Represents a platform where code is run, consisting of an operating system

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/RomeStepConfig.java renamed to plugin-gradle/src/main/java/com/diffplug/gradle/spotless/BiomeStepConfig.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 DiffPlug
2+
* Copyright 2023-2024 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,10 +28,10 @@
2828
import org.gradle.api.artifacts.repositories.MavenArtifactRepository;
2929

3030
import com.diffplug.spotless.FormatterStep;
31-
import com.diffplug.spotless.rome.BiomeFlavor;
32-
import com.diffplug.spotless.rome.RomeStep;
31+
import com.diffplug.spotless.biome.BiomeFlavor;
32+
import com.diffplug.spotless.biome.BiomeStep;
3333

34-
public abstract class RomeStepConfig<Self extends RomeStepConfig<Self>> {
34+
public abstract class BiomeStepConfig<Self extends BiomeStepConfig<Self>> {
3535
/**
3636
* Optional path to the directory with configuration file for Biome. The file
3737
* must be named {@code biome.json}. When none is given, the default
@@ -95,7 +95,7 @@ public abstract class RomeStepConfig<Self extends RomeStepConfig<Self>> {
9595
@Nullable
9696
private String version;
9797

98-
protected RomeStepConfig(Project project, Consumer<FormatterStep> replaceStep, BiomeFlavor flavor,
98+
protected BiomeStepConfig(Project project, Consumer<FormatterStep> replaceStep, BiomeFlavor flavor,
9999
String version) {
100100
this.project = requireNonNull(project);
101101
this.replaceStep = requireNonNull(replaceStep);
@@ -234,13 +234,13 @@ private File findDataDir() {
234234
*
235235
* @return A builder for a Biome step.
236236
*/
237-
private RomeStep newBuilder() {
237+
private BiomeStep newBuilder() {
238238
if (pathToExe != null) {
239239
var resolvedPathToExe = resolvePathToExe();
240-
return RomeStep.withExePath(flavor, resolvedPathToExe);
240+
return BiomeStep.withExePath(flavor, resolvedPathToExe);
241241
} else {
242242
var downloadDir = resolveDownloadDir();
243-
return RomeStep.withExeDownload(flavor, version, downloadDir);
243+
return BiomeStep.withExeDownload(flavor, version, downloadDir);
244244
}
245245
}
246246

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/FormatExtension.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import com.diffplug.spotless.LineEnding;
5454
import com.diffplug.spotless.OnMatch;
5555
import com.diffplug.spotless.Provisioner;
56+
import com.diffplug.spotless.biome.BiomeFlavor;
5657
import com.diffplug.spotless.cpp.ClangFormatStep;
5758
import com.diffplug.spotless.extra.EclipseBasedStepBuilder;
5859
import com.diffplug.spotless.extra.wtp.EclipseWtpFormatterStep;
@@ -67,7 +68,6 @@
6768
import com.diffplug.spotless.generic.TrimTrailingWhitespaceStep;
6869
import com.diffplug.spotless.npm.NpmPathResolver;
6970
import com.diffplug.spotless.npm.PrettierFormatterStep;
70-
import com.diffplug.spotless.rome.BiomeFlavor;
7171

7272
import groovy.lang.Closure;
7373

@@ -728,15 +728,15 @@ protected FormatterStep createStep() {
728728
* the file name. It should be specified as a formatter step for a generic
729729
* <code>format{ ... }</code>.
730730
*/
731-
public class BiomeGeneric extends RomeStepConfig<BiomeGeneric> {
731+
public class BiomeGeneric extends BiomeStepConfig<BiomeGeneric> {
732732
@Nullable
733733
String language;
734734

735735
/**
736-
* Creates a new Rome config that downloads the Rome executable for the given
736+
* Creates a new Biome config that downloads the Biome executable for the given
737737
* version from the network.
738738
*
739-
* @param version Rome version to use. The default version is used when
739+
* @param version Biome version to use. The default version is used when
740740
* <code>null</code>.
741741
*/
742742
public BiomeGeneric(String version) {
@@ -801,12 +801,12 @@ public PrettierConfig prettier(Map<String, String> devDependencies) {
801801
* offline, you can specify the path to the Biome executable via
802802
* {@code biome().pathToExe(...)}.
803803
*/
804-
public RomeStepConfig<?> biome() {
804+
public BiomeStepConfig<?> biome() {
805805
return biome(null);
806806
}
807807

808808
/** Downloads the given Biome version from the network. */
809-
public RomeStepConfig<?> biome(String version) {
809+
public BiomeStepConfig<?> biome(String version) {
810810
var biomeConfig = new BiomeGeneric(version);
811811
addStep(biomeConfig.createStep());
812812
return biomeConfig;

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/JavascriptExtension.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030

3131
import com.diffplug.common.collect.ImmutableList;
3232
import com.diffplug.spotless.FormatterStep;
33+
import com.diffplug.spotless.biome.BiomeFlavor;
3334
import com.diffplug.spotless.npm.EslintConfig;
3435
import com.diffplug.spotless.npm.EslintFormatterStep;
3536
import com.diffplug.spotless.npm.NpmPathResolver;
3637
import com.diffplug.spotless.npm.PrettierFormatterStep;
37-
import com.diffplug.spotless.rome.BiomeFlavor;
3838

3939
public class JavascriptExtension extends FormatExtension {
4040

@@ -161,7 +161,7 @@ public BiomeJs biome(String version) {
161161
/**
162162
* Biome formatter step for JavaScript.
163163
*/
164-
public class BiomeJs extends RomeStepConfig<BiomeJs> {
164+
public class BiomeJs extends BiomeStepConfig<BiomeJs> {
165165
/**
166166
* Creates a new Biome formatter step config for formatting JavaScript files.
167167
* Unless overwritten, the given Biome version is downloaded from the network.

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/JsonExtension.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
import javax.inject.Inject;
2323

2424
import com.diffplug.spotless.FormatterStep;
25+
import com.diffplug.spotless.biome.BiomeFlavor;
2526
import com.diffplug.spotless.json.JacksonJsonConfig;
2627
import com.diffplug.spotless.json.JacksonJsonStep;
2728
import com.diffplug.spotless.json.JsonPatchStep;
2829
import com.diffplug.spotless.json.JsonSimpleStep;
2930
import com.diffplug.spotless.json.gson.GsonStep;
30-
import com.diffplug.spotless.rome.BiomeFlavor;
3131

3232
public class JsonExtension extends FormatExtension {
3333
private static final int DEFAULT_INDENTATION = 4;
@@ -185,7 +185,7 @@ protected final FormatterStep createStep() {
185185
/**
186186
* Biome formatter step for JSON.
187187
*/
188-
public class BiomeJson extends RomeStepConfig<BiomeJson> {
188+
public class BiomeJson extends BiomeStepConfig<BiomeJson> {
189189
/**
190190
* Creates a new Biome formatter step config for formatting JSON files. Unless
191191
* overwritten, the given Biome version is downloaded from the network.

0 commit comments

Comments
 (0)