Skip to content

Commit 90d10ba

Browse files
authored
Refactor internal package hierarchy (#730)
- Logic for handling digests now lives in a `digests` package. - Moved `DigestConverter` to `digests` package; renamed to `DigestPlexusConverter`. - Moved `PathConverter` to `fs` package; renamed to `PathPlexusConverter`. - Moved `UriConverter` to `fs` package; renamed to `UriPlexusConverter`. - Moved `ProtobufMavenPluginConfigurator` to `mojo` package. - Deleted now-empty `*.mojo.plexus` package.
1 parent 2d202c7 commit 90d10ba

25 files changed

Lines changed: 59 additions & 59 deletions

protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/utils/Digest.java renamed to protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/digests/Digest.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 io.github.ascopes.protobufmavenplugin.utils;
16+
package io.github.ascopes.protobufmavenplugin.digests;
1717

1818
import java.io.ByteArrayInputStream;
1919
import java.io.IOException;

protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/utils/DigestException.java renamed to protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/digests/DigestException.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 io.github.ascopes.protobufmavenplugin.utils;
16+
package io.github.ascopes.protobufmavenplugin.digests;
1717

1818

1919
/**

protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/mojo/plexus/DigestConverter.java renamed to protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/digests/DigestPlexusConverter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.github.ascopes.protobufmavenplugin.mojo.plexus;
16+
package io.github.ascopes.protobufmavenplugin.digests;
1717

18-
import io.github.ascopes.protobufmavenplugin.utils.Digest;
1918
import java.util.Collections;
2019
import java.util.Locale;
2120
import java.util.Map;
@@ -30,7 +29,7 @@
3029
* @author Ashley Scopes
3130
* @since 3.5.0
3231
*/
33-
final class DigestConverter extends AbstractBasicConverter {
32+
public final class DigestPlexusConverter extends AbstractBasicConverter {
3433

3534
private static final Pattern PATTERN = Pattern.compile(
3635
"^(?<algorithm>[-a-z0-9]+):(?<digest>[0-9a-f]+)$",

protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/mojo/plexus/package-info.java renamed to protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/digests/package-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
* limitations under the License.
1515
*/
1616
/**
17-
* Overrides for how MOJOs are configured within Plexus and Sisu.
17+
* Hashing operations and support.
1818
*/
19-
package io.github.ascopes.protobufmavenplugin.mojo.plexus;
19+
package io.github.ascopes.protobufmavenplugin.digests;

protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/mojo/plexus/PathConverter.java renamed to protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/fs/PathPlexusConverter.java

Lines changed: 3 additions & 3 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 io.github.ascopes.protobufmavenplugin.mojo.plexus;
16+
package io.github.ascopes.protobufmavenplugin.fs;
1717

1818
import java.io.File;
1919
import java.nio.file.Path;
@@ -27,7 +27,7 @@
2727

2828

2929
/**
30-
* Converter for Path objects on the root file system.
30+
* Plexus/Sisu parameter converter for Path objects on the root file system.
3131
*
3232
* <p>We provide this to avoid using the URL and File APIs in the Mojo interface.
3333
*
@@ -37,7 +37,7 @@
3737
* @author Ashley Scopes
3838
* @since 3.1.3
3939
*/
40-
final class PathConverter extends FileConverter {
40+
public final class PathPlexusConverter extends FileConverter {
4141

4242
@Override
4343
public boolean canConvert(Class<?> type) {

protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/mojo/plexus/UriConverter.java renamed to protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/fs/UriPlexusConverter.java

Lines changed: 3 additions & 3 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 io.github.ascopes.protobufmavenplugin.mojo.plexus;
16+
package io.github.ascopes.protobufmavenplugin.fs;
1717

1818
import java.net.URI;
1919
import java.net.URISyntaxException;
@@ -22,7 +22,7 @@
2222

2323

2424
/**
25-
* Converter for URIs.
25+
* Plexus/Sisu parameter converter for URIs.
2626
*
2727
* <p>We provide this to avoid using the URL and File APIs in the Mojo interface. URLs do an
2828
* immediate lookup for the URL scheme's appropriate URLStreamHandlerProvider upon construction, and
@@ -41,7 +41,7 @@
4141
* @author Ashley Scopes
4242
* @since 3.1.3
4343
*/
44-
final class UriConverter extends AbstractBasicConverter {
44+
public final class UriPlexusConverter extends AbstractBasicConverter {
4545

4646
@Override
4747
public boolean canConvert(Class<?> type) {

protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/fs/UriResourceFetcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package io.github.ascopes.protobufmavenplugin.fs;
1717

18-
import io.github.ascopes.protobufmavenplugin.utils.Digest;
18+
import io.github.ascopes.protobufmavenplugin.digests.Digest;
1919
import io.github.ascopes.protobufmavenplugin.utils.ResolutionException;
2020
import java.io.BufferedInputStream;
2121
import java.io.BufferedOutputStream;

protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/generation/GenerationRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
import io.github.ascopes.protobufmavenplugin.dependencies.DependencyResolutionDepth;
1919
import io.github.ascopes.protobufmavenplugin.dependencies.MavenArtifact;
20+
import io.github.ascopes.protobufmavenplugin.digests.Digest;
2021
import io.github.ascopes.protobufmavenplugin.plugins.MavenProtocPlugin;
2122
import io.github.ascopes.protobufmavenplugin.plugins.PathProtocPlugin;
2223
import io.github.ascopes.protobufmavenplugin.plugins.UriProtocPlugin;
23-
import io.github.ascopes.protobufmavenplugin.utils.Digest;
2424
import java.nio.file.Path;
2525
import java.util.Collection;
2626
import java.util.List;

protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/mojo/AbstractGenerateMojo.java

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

2222
import io.github.ascopes.protobufmavenplugin.dependencies.DependencyResolutionDepth;
2323
import io.github.ascopes.protobufmavenplugin.dependencies.MavenDependencyBean;
24+
import io.github.ascopes.protobufmavenplugin.digests.Digest;
2425
import io.github.ascopes.protobufmavenplugin.generation.GenerationResult;
2526
import io.github.ascopes.protobufmavenplugin.generation.ImmutableGenerationRequest;
2627
import io.github.ascopes.protobufmavenplugin.generation.Language;
@@ -30,7 +31,6 @@
3031
import io.github.ascopes.protobufmavenplugin.plugins.MavenProtocPluginBean;
3132
import io.github.ascopes.protobufmavenplugin.plugins.PathProtocPluginBean;
3233
import io.github.ascopes.protobufmavenplugin.plugins.UriProtocPluginBean;
33-
import io.github.ascopes.protobufmavenplugin.utils.Digest;
3434
import java.nio.file.Files;
3535
import java.nio.file.Path;
3636
import java.util.Collection;

protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/mojo/MainGenerateMojo.java

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

1818
import io.github.ascopes.protobufmavenplugin.generation.OutputDescriptorAttachmentRegistrar;
1919
import io.github.ascopes.protobufmavenplugin.generation.SourceRootRegistrar;
20-
import io.github.ascopes.protobufmavenplugin.mojo.plexus.ProtobufMavenPluginConfigurator;
20+
import io.github.ascopes.protobufmavenplugin.mojo.ProtobufMavenPluginConfigurator;
2121
import java.nio.file.Path;
2222
import java.util.Collection;
2323
import java.util.List;

0 commit comments

Comments
 (0)