Skip to content

Commit

Permalink
Update dependencies for gradle v7
Browse files Browse the repository at this point in the history
  • Loading branch information
pmendelski committed Apr 11, 2021
1 parent 3f985b2 commit b8e5578
Show file tree
Hide file tree
Showing 16 changed files with 83 additions and 88 deletions.
10 changes: 9 additions & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.1.14] - 2021-04-11
### Changed
- Updated dependencies for Gradle v7

## [0.1.13] - 2021-02-23
### Changed
- Support Java 1.8 [#9](https://github.com/coditory/gradle-manifest-plugin/issues/9)
Expand Down Expand Up @@ -27,8 +31,9 @@
### Changed
- Fix SCM attributes generated in multi-module projects [#1](https://github.com/coditory/gradle-manifest-plugin/issues/1).

[Unreleased]: https://github.com/coditory/gradle-manifest-plugin/compare/v0.1.13...HEAD
[0.1.12]: https://github.com/coditory/gradle-manifest-plugin/compare/v0.1.12...v0.1.13
[Unreleased]: https://github.com/coditory/gradle-manifest-plugin/compare/v0.1.14...HEAD
[0.1.14]: https://github.com/coditory/gradle-manifest-plugin/compare/v0.1.13...v0.1.14
[0.1.13]: https://github.com/coditory/gradle-manifest-plugin/compare/v0.1.12...v0.1.13
[0.1.12]: https://github.com/coditory/gradle-manifest-plugin/compare/v0.1.11...v0.1.12
[0.1.11]: https://github.com/coditory/gradle-manifest-plugin/compare/v0.1.10...v0.1.11
[0.1.10]: https://github.com/coditory/gradle-manifest-plugin/compare/v0.1.9...v0.1.10
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ on [Adding Classes and Jars to Jar File's Classpath](https://docs.oracle.com/jav
Take a look at a [gradle-manifest-plugin-sample](https://github.com/coditory/gradle-manifest-plugin-sample).
You can copy [ManifestReader.java](https://github.com/coditory/gradle-manifest-plugin-sample/blob/master/src/main/java/com/coditory/sandbox/ManifestReader.java) (with [tests](https://github.com/coditory/gradle-manifest-plugin-sample/blob/master/src/test/groovy/com/coditory/sandbox/ManifestReaderTest.groovy)) to you own project.

Reading `MANIFEST.MF` is tricky. There can be mupltiple `MANIFEST.MF` files on the classpath that comes from libraries.
Reading `MANIFEST.MF` is tricky. There can be multiple `MANIFEST.MF` files on the classpath that comes from libraries.
To read the correct `MANIFEST.MF` you need to filter them. Most often `Implementation-Title` is used to find the correct one.

12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.4.20"
kotlin("jvm") version "1.4.31"
id("jacoco")
id("com.github.kt3k.coveralls") version "2.10.2"
id("com.gradle.plugin-publish") version "0.12.0"
id("com.github.kt3k.coveralls") version "2.12.0"
id("com.gradle.plugin-publish") version "0.14.0"
id("java-gradle-plugin")
id("maven-publish")
id("org.jlleitschuh.gradle.ktlint") version "9.4.1"
id("org.jlleitschuh.gradle.ktlint") version "10.0.0"
}

repositories {
jcenter()
mavenCentral()
}

ktlint {
version.set("0.39.0")
version.set("0.41.0")
}

dependencies {
Expand Down
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-6.8.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("com.gradle.enterprise").version("3.5.2")
id("com.gradle.enterprise").version("3.6.1")
}

gradleEnterprise {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.coditory.gradle.manifest

import com.coditory.gradle.manifest.base.SpecProjectBuilder
import com.coditory.gradle.manifest.base.SpecProjectBuilder.Companion.projectWithPlugins
import com.coditory.gradle.manifest.base.SystemOutputCapturer.Companion.captureSystemOutput
import com.coditory.gradle.manifest.base.TestProjectBuilder
import com.coditory.gradle.manifest.base.TestProjectBuilder.Companion.projectWithPlugins
import com.coditory.gradle.manifest.base.getManifestTask
import com.coditory.gradle.manifest.base.readFile
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

class GenerateManifestSpec {
class GenerateManifestTest {
private val expectedManifestKeys = listOf(
"Manifest-Version:",
"Main-Class:",
Expand Down Expand Up @@ -95,7 +95,7 @@ class GenerateManifestSpec {
assertThat(output).contains(expectedManifestKeys)
}

private fun projectBuilder(): SpecProjectBuilder {
private fun projectBuilder(): TestProjectBuilder {
return projectWithPlugins("sample-project")
.withGroup("com.coditory")
.withGitRepository()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.coditory.gradle.manifest

import com.coditory.gradle.manifest.base.SpecProjectBuilder
import com.coditory.gradle.manifest.base.TestProjectBuilder
import com.coditory.gradle.manifest.base.generateManifest
import org.assertj.core.api.Assertions.assertThat
import org.gradle.api.Project
import org.junit.jupiter.api.Test

class GenerateManifestWithoutDisabledAttributesSpec {
class GenerateManifestWithoutDisabledAttributesTest {
@Test
fun `should generate manifest without scm attributes`() {
// when
Expand Down Expand Up @@ -41,7 +41,7 @@ class GenerateManifestWithoutDisabledAttributesSpec {
}

private fun project(): Project {
return SpecProjectBuilder.projectWithPlugins()
return TestProjectBuilder.projectWithPlugins()
.withGroup("com.coditory")
.withGitRepository()
.withExtProperty("mainClassName", "com.coditory.MainClass")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.coditory.gradle.manifest

import com.coditory.gradle.manifest.ManifestPlugin.Companion.GENERATE_MANIFEST_TASK
import com.coditory.gradle.manifest.base.SpecProjectBuilder.Companion.projectWithPlugins
import com.coditory.gradle.manifest.base.TestProjectBuilder.Companion.projectWithPlugins
import org.assertj.core.api.Assertions.assertThat
import org.gradle.api.plugins.JavaPlugin
import org.gradle.language.jvm.tasks.ProcessResources
import org.junit.jupiter.api.Test

class PluginSetupSpec {
class PluginSetupTest {
private val project = projectWithPlugins()
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package com.coditory.gradle.manifest

import com.coditory.gradle.manifest.base.ManifestExtractor.extractManifestAttributes
import com.coditory.gradle.manifest.base.ManifestExtractor.extractManifestMap
import com.coditory.gradle.manifest.base.SpecProjectBuilder.Companion.projectWithPlugins
import com.coditory.gradle.manifest.base.SpecRepository.Companion.repository
import com.coditory.gradle.manifest.base.SystemProperties.withSystemProperties
import com.coditory.gradle.manifest.base.SystemProperties.withoutSystemProperties
import com.coditory.gradle.manifest.base.TestProjectBuilder.Companion.projectWithPlugins
import com.coditory.gradle.manifest.base.TestRepository.Companion.repository
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

class SetupManifestAttributesSpec {
class SetupManifestAttributesTest {
@Test
fun `should generate basic attributes for bare bone project with no git and no system properties`() {
// given
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.coditory.gradle.manifest.acceptance

import com.coditory.gradle.manifest.base.SpecProjectBuilder
import com.coditory.gradle.manifest.base.SpecRepository.Companion.COMMIT_MESSAGE
import com.coditory.gradle.manifest.base.TestProjectBuilder
import com.coditory.gradle.manifest.base.TestRepository.Companion.COMMIT_MESSAGE
import com.coditory.gradle.manifest.base.readFile
import com.coditory.gradle.manifest.base.runGradle
import org.assertj.core.api.Assertions.assertThat
Expand All @@ -11,8 +11,8 @@ import org.junit.jupiter.api.Test
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.ValueSource

class CommandLineAcceptanceSpec {
private val project = SpecProjectBuilder.project("sample-project")
class CommandLineAcceptanceTest {
private val project = TestProjectBuilder.project("sample-project")
.withBuildGradle(
"""
plugins {
Expand Down Expand Up @@ -69,7 +69,7 @@ class CommandLineAcceptanceSpec {

@AfterEach
fun removeProjectDir() {
SpecProjectBuilder.removeProjectDirs()
TestProjectBuilder.removeProjectDirs()
}

@ParameterizedTest(name = "should generate manifest on processResources command for gradle {0}")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.coditory.gradle.manifest.acceptance

import com.coditory.gradle.manifest.base.SpecProjectBuilder
import com.coditory.gradle.manifest.base.SpecProjectBuilder.Companion.projectWithPlugins
import com.coditory.gradle.manifest.base.TestProjectBuilder
import com.coditory.gradle.manifest.base.TestProjectBuilder.Companion.projectWithPlugins
import com.coditory.gradle.manifest.base.readFile
import com.coditory.gradle.manifest.base.runGradle
import org.assertj.core.api.Assertions.assertThat
Expand All @@ -12,10 +12,10 @@ import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.ValueSource
import java.util.regex.Pattern.DOTALL

class GenerateClasspathSpec {
class GenerateClasspathTest {
@AfterEach
fun removeProjectDir() {
SpecProjectBuilder.removeProjectDirs()
TestProjectBuilder.removeProjectDirs()
}

@ParameterizedTest(name = "should generate manifest with classpath for gradle {0}")
Expand All @@ -40,10 +40,9 @@ class GenerateClasspathSpec {
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter:2.4.2'
implementation 'com.github.slugify:slugify:2.4'
runtime 'org.hashids:hashids:1.0.3'
testCompile 'org.junit.jupiter:junit-jupiter-api:5.7.0'
runtimeOnly 'org.hashids:hashids:1.0.3'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
}
"""
)
Expand All @@ -59,24 +58,7 @@ class GenerateClasspathSpec {
// and
val manifest = project.readFile("build/resources/main/META-INF/MANIFEST.MF")
assertThat(manifest.replace("\r\n ", ""))
.contains("my/jars/slugify-2.4.jar")
.contains("my/jars/hashids-1.0.3.jar")
.contains("my/jars/spring-boot-starter-2.4.2.jar")

// and:
assertThat(manifest)
.contains(
"Class-Path: my/jars/spring-boot-starter-2.4.2.jar my/jars/slugify-2.4.\r\n" +
" jar my/jars/hashids-1.0.3.jar my/jars/spring-boot-autoconfigure-2.4.2\r\n" +
" .jar my/jars/spring-boot-2.4.2.jar my/jars/spring-boot-starter-loggin\r\n" +
" g-2.4.2.jar my/jars/jakarta.annotation-api-1.3.5.jar my/jars/spring-c\r\n" +
" ontext-5.3.3.jar my/jars/spring-aop-5.3.3.jar my/jars/spring-beans-5.\r\n" +
" 3.3.jar my/jars/spring-expression-5.3.3.jar my/jars/spring-core-5.3.3\r\n" +
" .jar my/jars/snakeyaml-1.27.jar my/jars/icu4j-64.2.jar my/jars/logbac\r\n" +
" k-classic-1.2.3.jar my/jars/log4j-to-slf4j-2.13.3.jar my/jars/jul-to-\r\n" +
" slf4j-1.7.30.jar my/jars/spring-jcl-5.3.3.jar my/jars/logback-core-1.\r\n" +
" 2.3.jar my/jars/slf4j-api-1.7.30.jar my/jars/log4j-api-2.13.3.jar\r\n"
)
.contains("Class-Path: my/jars/slugify-2.4.jar my/jars/hashids-1.0.3.jar my/jars/icu4j-64.2.jar\r\n")
.matches(".*Class-Path: [^:]+(Built-JDK: [^:]+)?$".toPattern(DOTALL))
}

Expand All @@ -101,7 +83,7 @@ class GenerateClasspathSpec {
}
dependencies {
compile 'com.github.slugify:slugify:2.4'
implementation 'com.github.slugify:slugify:2.4'
}
"""
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.coditory.gradle.manifest.acceptance

import com.coditory.gradle.manifest.base.SpecProjectBuilder
import com.coditory.gradle.manifest.base.SpecProjectBuilder.Companion.projectWithPlugins
import com.coditory.gradle.manifest.base.TestProjectBuilder
import com.coditory.gradle.manifest.base.TestProjectBuilder.Companion.projectWithPlugins
import com.coditory.gradle.manifest.base.readFile
import com.coditory.gradle.manifest.base.runGradle
import org.assertj.core.api.Assertions.assertThat
Expand All @@ -10,10 +10,10 @@ import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.ValueSource

class GenerateWithCustomAttributesSpec {
class GenerateWithCustomAttributesTest {
@AfterEach
fun removeProjectDir() {
SpecProjectBuilder.removeProjectDirs()
TestProjectBuilder.removeProjectDirs()
}

@ParameterizedTest(name = "should generate manifest with custom attributes for gradle {0}")
Expand Down Expand Up @@ -47,8 +47,8 @@ class GenerateWithCustomAttributesSpec {
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter:2.4.2'
testCompile 'org.junit.jupiter:junit-jupiter-api:5.7.0'
compileOnly 'org.springframework.boot:spring-boot-starter:2.4.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
}
"""
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.coditory.gradle.manifest.acceptance

import com.coditory.gradle.manifest.base.SpecProjectBuilder
import com.coditory.gradle.manifest.base.SpecRepository.Companion.COMMIT_MESSAGE
import com.coditory.gradle.manifest.base.TestProjectBuilder
import com.coditory.gradle.manifest.base.TestRepository.Companion.COMMIT_MESSAGE
import com.coditory.gradle.manifest.base.readFile
import com.coditory.gradle.manifest.base.runGradle
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test

class MultiModuleAcceptanceSpec {
private val parentProject = SpecProjectBuilder.project("parent-project")
class MultiModuleAcceptanceTest {
private val parentProject = TestProjectBuilder.project("parent-project")
.withBuildGradle(
"""
plugins {
Expand Down Expand Up @@ -38,7 +38,7 @@ class MultiModuleAcceptanceSpec {
.withGitRepository()
.build()

private val projectA = SpecProjectBuilder.project("project-a", parentProject.projectDir.resolve("project-a"))
private val projectA = TestProjectBuilder.project("project-a", parentProject.projectDir.resolve("project-a"))
.withBuildGradle(
"""
plugins {
Expand Down Expand Up @@ -69,7 +69,7 @@ class MultiModuleAcceptanceSpec {
)
.build()

private val projectB = SpecProjectBuilder.project("project-b", parentProject.projectDir.resolve("project-b"))
private val projectB = TestProjectBuilder.project("project-b", parentProject.projectDir.resolve("project-b"))
.withBuildGradle(
"""
plugins {
Expand Down Expand Up @@ -121,7 +121,7 @@ class MultiModuleAcceptanceSpec {

@AfterEach
fun removeProjectDir() {
SpecProjectBuilder.removeProjectDirs()
TestProjectBuilder.removeProjectDirs()
}

@Test
Expand Down
Loading

0 comments on commit b8e5578

Please sign in to comment.