diff --git a/CHANGELOG.md b/CHANGELOG.md index 973d418..06f2968 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +## [1.2.0] - 2021-07-17 +### Changed +- Updated dependencies + ## [1.1.0] - 2021-04-12 ### Changed - Update default node and npm version @@ -15,7 +19,8 @@ ### Changed - Fix `npm install` command, so it uses `package-lock.json`. -[Unreleased]: https://github.com/coditory/gradle-webjar-plugin/compare/v1.1.0...HEAD -[1.0.3]: https://github.com/coditory/gradle-webjar-plugin/compare/v1.0.3...v1.1.0 +[Unreleased]: https://github.com/coditory/gradle-webjar-plugin/compare/v1.2.0...HEAD +[1.2.0]: https://github.com/coditory/gradle-webjar-plugin/compare/v1.1.0...v1.2.0 +[1.1.0]: https://github.com/coditory/gradle-webjar-plugin/compare/v1.0.3...v1.1.0 [1.0.3]: https://github.com/coditory/gradle-webjar-plugin/compare/v1.0.2...v1.0.3 [1.0.2]: https://github.com/coditory/gradle-webjar-plugin/compare/v1.0.1...v1.0.2 diff --git a/README.md b/README.md index d5a6e82..0a30e76 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,14 @@ [![Gradle Plugin Portal](https://img.shields.io/badge/Plugin_Portal-v1.1.0-green.svg)](https://plugins.gradle.org/plugin/com.coditory.webjar) [![Join the chat at https://gitter.im/coditory/gradle-webjar-plugin](https://badges.gitter.im/coditory/gradle-webjar-plugin.svg)](https://gitter.im/coditory/gradle-webjar-plugin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -This plugin connects JVM and Node based projects. -It maps typical java to npm tasks (build, test, clean, etc). +Plugin that makes it easy to create SPA applications with Java back end. It connects JVM and Node.js based projects. + +It maps typical java tasks to npm tasks (build, test, clean, etc). The build result is packed into a jar file, so it can be imported as a dependency by a java project. -This plugin builds frontend submodules. It can be also used to build a [webjar libraries](#building-webjar-library). See [sample usage](https://github.com/coditory/gradle-webjar-plugin-sample). +- This plugin builds frontend submodules. It can be also used to build a [webjar libraries](#building-webjar-library). + See [sample usage](https://github.com/coditory/gradle-webjar-plugin-sample). +- Tested with gradle version >= 7.1 ## Enabling the plugin @@ -92,9 +95,9 @@ You can configure Node and NPM with: ```gradle node { // Version of node to use. - version = '15.14.0' + version = '16.5.0' // Version of npm to use. - npmVersion = '7.7.6' + npmVersion = '7.19.1' // Base URL for fetching node distributions (change if you have a mirror). // Or set to null if you want to add the repository on your own. distBaseUrl = 'https://nodejs.org/dist' diff --git a/build.gradle.kts b/build.gradle.kts index ef54a36..c1c07e4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,10 +4,10 @@ plugins { kotlin("jvm") version "1.4.31" id("jacoco") id("com.github.kt3k.coveralls") version "2.12.0" - id("com.gradle.plugin-publish") version "0.14.0" + id("com.gradle.plugin-publish") version "0.15.0" id("java-gradle-plugin") id("maven-publish") - id("org.jlleitschuh.gradle.ktlint") version "10.0.0" + id("org.jlleitschuh.gradle.ktlint") version "10.1.0" } repositories { @@ -20,13 +20,12 @@ ktlint { } dependencies { - implementation(gradleApi()) - implementation("com.github.node-gradle:gradle-node-plugin:3.0.1") + implementation("com.github.node-gradle:gradle-node-plugin:3.1.0") - testImplementation("org.assertj:assertj-core:3.19.0") - testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.1") - testImplementation("org.junit.jupiter:junit-jupiter-params:5.7.1") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.1") + testImplementation("org.assertj:assertj-core:3.20.2") + testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.2") + testImplementation("org.junit.jupiter:junit-jupiter-params:5.7.2") + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.2") } group = "com.coditory.gradle" @@ -48,8 +47,8 @@ tasks.withType().configureEach { tasks.jacocoTestReport { reports { - xml.isEnabled = true - html.isEnabled = true + xml.required.set(true) + html.required.set(true) } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c..7454180 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3c4101c..af7be50 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 4f906e0..744e882 100755 --- a/gradlew +++ b/gradlew @@ -72,7 +72,7 @@ case "`uname`" in Darwin* ) darwin=true ;; - MINGW* ) + MSYS* | MINGW* ) msys=true ;; NONSTOP* ) diff --git a/src/main/kotlin/com/coditory/gradle/webjar/WebjarPlugin.kt b/src/main/kotlin/com/coditory/gradle/webjar/WebjarPlugin.kt index f2f4f33..3fd8ea4 100644 --- a/src/main/kotlin/com/coditory/gradle/webjar/WebjarPlugin.kt +++ b/src/main/kotlin/com/coditory/gradle/webjar/WebjarPlugin.kt @@ -5,7 +5,7 @@ import com.github.gradle.node.NodePlugin import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.plugins.JavaPlugin -import org.gradle.api.plugins.JavaPluginConvention +import org.gradle.api.plugins.JavaPluginExtension import org.gradle.api.tasks.SourceSet open class WebjarPlugin : Plugin { @@ -20,7 +20,7 @@ open class WebjarPlugin : Plugin { private fun setupNodePlugin(project: Project, webjar: WebjarExtension) { project - .convention.getPlugin(JavaPluginConvention::class.java) + .extensions.getByType(JavaPluginExtension::class.java) .sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME) .resources.srcDir(project.buildDir.resolve(webjar.outputDir)) project.plugins.apply(NodePlugin::class.java) @@ -29,8 +29,8 @@ open class WebjarPlugin : Plugin { it.npmWorkDir.set(project.projectDir.resolve(".node/npm")) it.yarnWorkDir.set(project.projectDir.resolve(".node/yarn")) it.download.set(true) - it.version.set("15.14.0") - it.npmVersion.set("7.7.6") + it.version.set("16.5.0") + it.npmVersion.set("7.19.1") } } diff --git a/src/test/kotlin/acceptance/BuildProjectTest.kt b/src/test/kotlin/acceptance/BuildProjectTest.kt index 70a68c5..efe8584 100644 --- a/src/test/kotlin/acceptance/BuildProjectTest.kt +++ b/src/test/kotlin/acceptance/BuildProjectTest.kt @@ -74,7 +74,7 @@ class BuildProjectTest { .build() @ParameterizedTest(name = "should clean build webjar for gradle version: {0}") - @ValueSource(strings = ["current", "6.0"]) + @ValueSource(strings = ["current", "7.1"]) fun `should clean build webjar`(gradleVersion: String?) { val result = runGradle(project, listOf("clean", "build"), gradleVersion) assertThat(result.task(":clean")?.outcome).isEqualTo(UP_TO_DATE) @@ -113,7 +113,7 @@ class BuildProjectTest { } private fun expectNodeAndNpmVersionFiles() { - assertThat(project.readFile("node_modules/.nodeVersion")).isEqualTo("15.14.0") - assertThat(project.readFile("node_modules/.npmVersion")).isEqualTo("7.7.6") + assertThat(project.readFile("node_modules/.nodeVersion")).isEqualTo("16.5.0") + assertThat(project.readFile("node_modules/.npmVersion")).isEqualTo("7.19.1") } }