Skip to content

Commit

Permalink
Cleanup and dependency reduction (#1023)
Browse files Browse the repository at this point in the history
* Remove dependency on org.apache.commons.io.FileUtils in MavenProjectConfigCollectorTestIT

* Remove support for preprocess-adoc and naturalize-adoc which are not used.

* Use build tools FileUtils.touch() method
  • Loading branch information
barchetta authored Feb 23, 2024
1 parent 764ba62 commit 24bf682
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 705 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021 Oracle and/or its affiliates.
* Copyright (c) 2020, 2024 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,11 +20,11 @@
import java.nio.file.Path;

import io.helidon.build.cli.common.ProjectConfig;
import io.helidon.build.common.FileUtils;
import io.helidon.build.common.test.utils.ConfigurationParameterSource;
import io.helidon.build.devloop.BuildExecutor;
import io.helidon.build.devloop.TestMonitor;

import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.junit.jupiter.params.ParameterizedTest;
Expand All @@ -41,7 +41,6 @@

/**
* Unit test for class {@link MavenProjectConfigCollector}.
*
* NOTE: This test requires that the snapshot jar is already built, so is disabled by default; to run:
* <pre>
* mvn install -DskipTests && mvn test -Dtest=MavenProjectConfigCollectorTest
Expand Down Expand Up @@ -91,7 +90,7 @@ void testWithoutCompile(String basedir) throws Exception {
final Path dotHelidonFile = projectDir.resolve(DOT_HELIDON);

Files.deleteIfExists(dotHelidonFile);
FileUtils.touch(dotHelidonFile.toFile());
FileUtils.touch(dotHelidonFile);
ProjectConfig config = ProjectConfig.projectConfig(projectDir);
assertThat(config.keySet().isEmpty(), is(true));

Expand All @@ -113,7 +112,7 @@ void testWithCompile(String basedir) throws Exception {
final Path dotHelidonFile = projectDir.resolve(DOT_HELIDON);

Files.deleteIfExists(dotHelidonFile);
FileUtils.touch(dotHelidonFile.toFile());
FileUtils.touch(dotHelidonFile);
ProjectConfig config = ProjectConfig.projectConfig(projectDir);
assertThat(config.keySet().isEmpty(), is(true));

Expand Down
34 changes: 0 additions & 34 deletions maven-plugins/sitegen-maven-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,40 +61,6 @@ Serve the site.

All parameters are mapped to user properties of the form `sitegen.PROPERTY`.

## Goal: `preprocess-adoc`

Pre-includes included text specified by AsciiDoc `include::` directives into
an `.adoc` file, adding AsciiDoc comments to track where each snippet of
included content is in the updated file and where it came from.

### Optional Parameters

| Property | Type | Default<br/>Value | Description |
|-----------------|---------|----------------------|----------------------------------------------------------------|
| inputDirectory | File | `${project.basedir}` | Directory containing the files to be processed |
| outputDirectory | File | `${project.basedir}` | Directory where the reformatted `.adoc` file should be written |
| checkPreprocess | Boolean | `false` | Check that the input and output files are the same |
| includes | List | [] | List of files to include |
| exclude | List | [] | List of files to exclude |

All parameters are mapped to user properties of the form `sitegen.PROPERTY`.

## Goal: `naturalize-adoc`

Converts a preprocessed `.adoc` file back into natural form with conventional
`include::` directives.

### Optional Parameters

| Property | Type | Default<br/>Value | Description |
|-----------------|------|----------------------|----------------------------------------------------------------|
| inputDirectory | File | `${project.basedir}` | Directory containing the files to be processed |
| outputDirectory | File | `${project.basedir}` | Directory where the reformatted `.adoc` file should be written |
| includes | List | [] | List of files to include |
| exclude | List | [] | List of files to exclude |

All parameters are mapped to user properties of the form `sitegen.PROPERTY`.

## Site Config File

The site configuration file is used to configure the following:
Expand Down
1 change: 1 addition & 0 deletions maven-plugins/sitegen-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
<dependency>
<groupId>com.github.wumpz</groupId>
<artifactId>diffutils</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.helidon.build-tools.common</groupId>
Expand Down
Loading

0 comments on commit 24bf682

Please sign in to comment.