Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyavy authored Dec 3, 2023
1 parent f2bd266 commit 9a6242a
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 27 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM gradle:jdk17
# Install plugin from sources
COPY build.gradle plugin/build.gradle
COPY src/main plugin/src/main
COPY README.md target* plugin/target/
RUN cd plugin && gradle publishToMavenLocal
COPY build plugin/build
RUN cd plugin && git init && gradle publishToMavenLocal

# Copy test project
COPY src/system-test/resources/* /test-projects/
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ plugins {
id 'io.github.pepperkit.git-hooks-gradle-plugin' version '1.0.0'
}
apply plugin: 'java'
apply plugin: 'io.github.pepperkit.git-hooks-gradle-plugin'
compileJava {
// Initialize git hooks each time the project is compiled
dependsOn initGitHooks
Expand All @@ -33,7 +30,6 @@ gitHooksGradlePlugin {
'pre-push' : 'gradle -q test'
]
}
```

Hook's content is any command line script, which is considered successful if exit code is equal to `0`, and not otherwise.
Expand Down
44 changes: 24 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ plugins {

id 'maven-publish'
id 'com.gradle.plugin-publish' version '1.2.1'

id 'io.github.pepperkit.git-hooks-gradle-plugin' version '1.0.0'
}

java {
Expand All @@ -35,7 +37,6 @@ gradlePlugin {
}
}


repositories {
mavenLocal()
mavenCentral()
Expand All @@ -47,29 +48,28 @@ java {
}

checkstyle {
toolVersion '10.12.2'
toolVersion '10.12.5'
config project.resources.text
.fromUri(new URI("https://raw.githubusercontent.com/pepperkit/java-style-guide/v1.0.2-9.2/checkstyle.xml"))
}

testing {
suites {
test {
configureEach {
useJUnitJupiter()

dependencies {
implementation 'org.junit.jupiter:junit-jupiter:5.10.0'
implementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
implementation 'org.junit.jupiter:junit-jupiter:5.10.1'
implementation 'org.junit.jupiter:junit-jupiter-engine:5.10.1'
implementation 'org.junit.platform:junit-platform-suite:1.10.0'
implementation 'org.mockito:mockito-core:5.4.0'
implementation 'org.mockito:mockito-core:5.7.0'
implementation 'org.assertj:assertj-core:3.24.2'

}
}

systemTest(JvmTestSuite) {
useJUnitJupiter()
test {
}

systemTest(JvmTestSuite) {
sources {
java {
srcDirs = ['src/system-test/java']
Expand All @@ -82,16 +82,9 @@ testing {
dependencies {
implementation project()

implementation 'org.junit.jupiter:junit-jupiter:5.10.0'
implementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
implementation 'org.junit.platform:junit-platform-suite:1.10.0'
implementation 'org.mockito:mockito-core:5.4.0'
implementation 'org.assertj:assertj-core:3.24.2'

implementation('org.testcontainers:junit-jupiter:1.18.3')

implementation("io.cucumber:cucumber-java:7.13.0")
implementation("io.cucumber:cucumber-junit-platform-engine:7.13.0")
implementation('org.testcontainers:junit-jupiter:1.19.3')
implementation("io.cucumber:cucumber-java:7.14.1")
implementation("io.cucumber:cucumber-junit-platform-engine:7.14.1")
}
}
}
Expand All @@ -118,3 +111,14 @@ sonar {
property "sonar.exclusions", "**GitHooksManager.java"
}
}

compileJava {
dependsOn initGitHooks
}

gitHooksGradlePlugin {
hooks = [
'pre-commit' : 'gradle -q checkstyleMain',
'pre-push' : 'gradle -q test'
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class GitHooksManager {

/**
* Creates GitHooksManager with the provided plugin. Mojo is used to obtain the correct logger.
* @param logger
* @param logger logger
*/
public GitHooksManager(Logger logger) {
this.logger = logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public void apply(Project project) {
initGitHooks.doLast(task -> initGitHooks(task, extension.getHooks().get()));
}

/**
* Installs configured git hooks.
* @param task task
* @param hooks map of hooks (hook-name -> hook-value)
*/
protected void initGitHooks(Task task, Map<String, String> hooks) {
logger.info("Git Hooks Plugin is launched");
logger.debug("Hooks: {}", hooks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@
*/
public interface GitHooksPluginExtension {

/**
* Git hooks configuration (hook-name -> hook-value).
* @return configured hooks
*/
MapProperty<String, String> getHooks();
}

0 comments on commit 9a6242a

Please sign in to comment.