Skip to content

Commit

Permalink
feat: removed task cleanFrontend (#273) (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1nc3n4 authored Nov 28, 2024
1 parent 5d3ff0b commit c673f5f
Show file tree
Hide file tree
Showing 94 changed files with 722 additions and 1,140 deletions.
6 changes: 0 additions & 6 deletions plugins/buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,3 @@ plugins {
dependencies {
implementation(gradleApi())
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
2 changes: 0 additions & 2 deletions plugins/frontend-jdk11/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.siouan.frontendgradleplugin.GradleTestListener

val fgpJdkVersion: String by extra
val fgpGroup: String by extra
val fgpVersion: String by extra
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ void setUp() throws IOException {
@Test
void should_skip_task_when_package_json_file_does_not_exist() throws IOException {
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"))
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"))
.assembleScript("run assemble")
.packageJsonDirectory(packageJsonDirectoryPath);
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());
Expand All @@ -59,8 +59,8 @@ void should_skip_task_when_package_json_file_does_not_exist() throws IOException
void should_skip_task_when_script_is_not_defined() throws IOException {
Files.copy(getResourcePath("package-any-manager.json"), packageJsonDirectoryPath.resolve("package.json"));
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"))
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"))
.packageJsonDirectory(packageJsonDirectoryPath);
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

Expand All @@ -77,8 +77,8 @@ void should_skip_task_when_script_is_not_defined() throws IOException {
void should_skip_task_when_running_gradle_task_and_script_is_not_defined() throws IOException {
Files.copy(getResourcePath("package-any-manager.json"), packageJsonDirectoryPath.resolve("package.json"));
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"))
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"))
.packageJsonDirectory(packageJsonDirectoryPath);
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

Expand All @@ -95,8 +95,8 @@ void should_skip_task_when_running_gradle_task_and_script_is_not_defined() throw
void should_assemble_frontend() throws IOException {
Files.copy(getResourcePath("package-any-manager.json"), packageJsonDirectoryPath.resolve("package.json"));
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"))
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"))
.packageJsonDirectory(packageJsonDirectoryPath)
.assembleScript("run assemble");
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ private FrontendMapBuilder configureServerAndPlugin(final String nodeDistributio
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder().verboseModeEnabled(false);
if (nodeDistributionUrlRoot != null) {
frontendMapBuilder
.nodeVersion("20.18.0")
.nodeVersion("22.11.0")
.nodeDistributionUrlRoot(nodeDistributionUrlRoot)
.nodeDistributionUrlPathPattern(NODE_DISTRIBUTION_URL_PATH_PATTERN);
distributionServerConfigurator.withNodeDistribution();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class CheckFrontendTaskFuncTest {
@Test
void should_skip_task_when_package_json_file_does_not_exist() throws IOException {
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"))
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"))
.checkScript("run check");
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

Expand All @@ -50,8 +50,8 @@ void should_skip_task_when_package_json_file_does_not_exist() throws IOException
void should_skip_task_when_script_is_not_defined() throws IOException {
Files.copy(getResourcePath("package-any-manager.json"), projectDirectoryPath.resolve("package.json"));
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"));
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"));
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

final BuildResult result1 = runGradle(projectDirectoryPath, CHECK_TASK_NAME);
Expand All @@ -67,8 +67,8 @@ void should_skip_task_when_script_is_not_defined() throws IOException {
void should_skip_task_when_running_gradle_task_and_script_is_not_defined() throws IOException {
Files.copy(getResourcePath("package-any-manager.json"), projectDirectoryPath.resolve("package.json"));
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"));
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"));
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

final BuildResult result1 = runGradle(projectDirectoryPath, GRADLE_CHECK_TASK_NAME);
Expand All @@ -84,8 +84,8 @@ void should_skip_task_when_running_gradle_task_and_script_is_not_defined() throw
void should_check_frontend() throws IOException {
Files.copy(getResourcePath("package-any-manager.json"), projectDirectoryPath.resolve("package.json"));
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"))
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"))
.checkScript("run check");
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class InstallCorepackTaskFuncTest {
@Test
void should_skip_task_when_corepack_version_property_is_null() throws IOException {
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"));
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"));
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

final BuildResult result = runGradle(projectDirectoryPath, INSTALL_COREPACK_TASK_NAME);
Expand All @@ -58,9 +58,9 @@ void should_fail_when_node_install_directory_is_not_a_directory() throws IOExcep
void should_install_corepack() throws IOException {
Files.copy(getResourcePath("package-any-manager.json"), projectDirectoryPath.resolve("package.json"));
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeVersion("22.11.0")
.corepackVersion(LATEST_VERSION_ARGUMENT)
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"));
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"));
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

final BuildResult result1 = runGradle(projectDirectoryPath, INSTALL_COREPACK_TASK_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class InstallFrontendTaskFuncTest {
@Test
void should_skip_task_when_package_json_file_does_not_exist() throws IOException {
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"));
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"));
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

final BuildResult result1 = runGradle(projectDirectoryPath, INSTALL_FRONTEND_TASK_NAME);
Expand All @@ -48,8 +48,8 @@ void should_skip_task_when_package_json_file_does_not_exist() throws IOException
void should_succeed_with_default_script() throws IOException {
Files.copy(getResourcePath("package-any-manager.json"), projectDirectoryPath.resolve("package.json"));
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"));
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"));
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

final BuildResult result1 = runGradle(projectDirectoryPath, INSTALL_FRONTEND_TASK_NAME);
Expand All @@ -65,8 +65,8 @@ void should_succeed_with_default_script() throws IOException {
void should_succeed_with_custom_script() throws IOException {
Files.copy(getResourcePath("package-any-manager.json"), projectDirectoryPath.resolve("package.json"));
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"))
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"))
.installScript("ci");
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void should_fail_when_distribution_cannot_be_downloaded_due_to_an_unknown_versio
@Test
void should_fail_when_distribution_download_url_is_invalid() throws IOException {
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeVersion("22.11.0")
.nodeDistributionUrlRoot("protocol://domain/unknown");
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

Expand All @@ -71,8 +71,8 @@ void should_fail_when_distribution_download_url_is_invalid() throws IOException
@Test
void should_succeed_first_time_and_be_up_to_date_next_time() throws IOException {
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"));
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"));
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

final BuildResult result1 = runGradle(projectDirectoryPath, INSTALL_NODE_TASK_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class InstallPackageManagerTaskFuncTest {
@Test
void should_skip_task_when_package_json_file_does_not_exist() throws IOException {
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"));
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"));
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

final BuildResult result1 = runGradle(projectDirectoryPath, INSTALL_PACKAGE_MANAGER_TASK_NAME);
Expand All @@ -61,8 +61,8 @@ void should_fail_when_node_install_directory_is_not_a_directory() throws IOExcep
void should_install_package_managers() throws IOException {
Files.copy(getResourcePath("package-npm.json"), projectDirectoryPath.resolve("package.json"));
final FrontendMapBuilder frontendMapBuilder = new FrontendMapBuilder()
.nodeVersion("20.18.0")
.nodeDistributionUrl(getResourcePath("node-v20.18.0.zip"));
.nodeVersion("22.11.0")
.nodeDistributionUrl(getResourcePath("node-v22.11.0.zip"));
createBuildFile(projectDirectoryPath, frontendMapBuilder.toMap());

final BuildResult installNpmResult1 = runGradle(projectDirectoryPath, INSTALL_PACKAGE_MANAGER_TASK_NAME);
Expand Down
Loading

0 comments on commit c673f5f

Please sign in to comment.