Skip to content

Commit

Permalink
Update dependencies and default node version
Browse files Browse the repository at this point in the history
  • Loading branch information
pmendelski committed Jul 17, 2021
1 parent d57e34b commit b8bbf7c
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 26 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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'
Expand Down
19 changes: 9 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"
Expand All @@ -48,8 +47,8 @@ tasks.withType<KotlinCompile>().configureEach {

tasks.jacocoTestReport {
reports {
xml.isEnabled = true
html.isEnabled = true
xml.required.set(true)
html.required.set(true)
}
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ case "`uname`" in
Darwin* )
darwin=true
;;
MINGW* )
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )
Expand Down
8 changes: 4 additions & 4 deletions src/main/kotlin/com/coditory/gradle/webjar/WebjarPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<Project> {
Expand All @@ -20,7 +20,7 @@ open class WebjarPlugin : Plugin<Project> {

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)
Expand All @@ -29,8 +29,8 @@ open class WebjarPlugin : Plugin<Project> {
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")
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/test/kotlin/acceptance/BuildProjectTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
}
}

0 comments on commit b8bbf7c

Please sign in to comment.