Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- image: circleci/openjdk:8-jdk

steps:
- run: curl -vkL -o - https://github.com/intuit/auto/releases/download/v10.32.1/auto-linux.gz | gunzip > ~/auto
- run: curl -vkL -o - https://github.com/intuit/auto/releases/download/v10.36.5/auto-linux.gz | gunzip > ~/auto
- run: chmod a+x ~/auto
- checkout
- run: ~/auto shipit -vvv
Expand Down
8 changes: 4 additions & 4 deletions .fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ cli:
project: [email protected]:intuit/hooks
analyze:
modules:
- name: compiler-plugin
type: gradle
target: 'compiler-plugin:'
path: .
- name: docs
type: gradle
target: 'docs:'
Expand All @@ -36,3 +32,7 @@ analyze:
type: gradle
target: 'maven-plugin:'
path: .
- name: processor
type: gradle
target: 'processor:'
path: .
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Hooks represent "pluggable" points in a software model. They provide a mechanism
- Asynchronous support built on Kotlin [coroutines](https://kotlinlang.org/docs/coroutines-guide.html)
- Support for additional [hook context](https://intuit.github.io/hooks/wiki/key-concepts/#hook-context) and [interceptors](https://intuit.github.io/hooks/wiki/key-concepts/#interceptors)

Along with the base library, we created a Kotlin compiler plugin to enable hooks to be created with a simple typed-based DSL, limiting the redundancy and overhead required to subclass a hook.
Along with the base library, we created a Kotlin symbol processor to enable hooks to be created with a simple typed-based DSL, limiting the redundancy and overhead required to subclass a hook.

Visit our [site](https://intuit.github.io/hooks/) for information about how to use hooks.

Expand All @@ -44,12 +44,12 @@ library for the JVM plus an [Arrow Meta](https://meta.arrow-kt.io/) Compiler Plu

## Structure

- [hooks](https://github.com/intuit/hooks/tree/master/hooks) - The actual implementation of the hooks
- [compiler-plugin](https://github.com/intuit/hooks/tree/master/compiler-plugin) - An Arrow Meta compiler plugin that generates hook subclasses for you
- [gradle-plugin](https://github.com/intuit/hooks/tree/master/gradle-plugin) - A gradle plugin to make using the compiler plugin easier
- [maven-plugin](https://github.com/intuit/hooks/tree/master/maven-plugin) - A maven Kotlin plugin extension to make using the compiler plugin easier
- [example-library](https://github.com/intuit/hooks/tree/master/example-library) - A library that exposes extension points for consumers using the hooks' `call` function
- [example-application](https://github.com/intuit/hooks/tree/master/example-application) - The Application that demonstrates extending a library by calling the hooks' `tap` function
- [hooks](https://github.com/intuit/hooks/tree/main/hooks) - The actual implementation of the hooks
- [processor](https://github.com/intuit/hooks/tree/main/processor) - A Kotlin Symbol Processor that generates hook subclasses for you
- [gradle-plugin](https://github.com/intuit/hooks/tree/main/gradle-plugin) - A Gradle plugin to make using the processor easier
- [maven-plugin](https://github.com/intuit/hooks/tree/main/maven-plugin) - A Maven Kotlin plugin extension to make using the processor easier
- [example-library](https://github.com/intuit/hooks/tree/main/example-library) - A library that exposes extension points for consumers using the hooks' `call` function
- [example-application](https://github.com/intuit/hooks/tree/main/example-application) - The Application that demonstrates extending a library by calling the hooks' `tap` function

## :beers: Contributing :beers:

Expand Down
43 changes: 22 additions & 21 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

allprojects {
repositories {
jcenter()
mavenLocal()
mavenCentral()
maven("https://plugins.gradle.org/m2/")
Expand All @@ -16,16 +15,16 @@ allprojects {
}

plugins {
kotlin("jvm") apply false
id("jacoco")
alias(libs.plugins.kotlin.jvm) apply false
jacoco

id("net.researchgate.release")
id("io.github.gradle-nexus.publish-plugin")
alias(libs.plugins.release)
alias(libs.plugins.nexus)

id("org.jlleitschuh.gradle.ktlint")
id("org.jetbrains.kotlinx.binary-compatibility-validator")
alias(libs.plugins.ktlint)
alias(libs.plugins.api)

id("org.jetbrains.dokka")
alias(libs.plugins.dokka)
}

val shouldntPublish = listOf("docs", "example-library", "example-application")
Expand Down Expand Up @@ -83,11 +82,12 @@ subprojects {
plugin("jacoco")
plugin("org.jlleitschuh.gradle.ktlint")
}

jacoco {
toolVersion = "0.8.7"
}

if (publishModules.contains(name)) {
if (publishModules.contains(name) && name != "gradle-plugin") {
apply {
plugin("maven-publish")
plugin("signing")
Expand Down Expand Up @@ -133,15 +133,6 @@ subprojects {
}
}

configure<SigningExtension> {
val signingKey by auth {
it?.replace("\\n", "\n")
}
val signingPassword by auth
useInMemoryPgpKeys(signingKey, signingPassword)
sign(extensions.findByType(PublishingExtension::class.java)!!.publications)
}

tasks {
register<Jar>("javadocJar") {
dependsOn("dokkaJavadoc")
Expand All @@ -157,9 +148,21 @@ subprojects {
}
}

extensions.findByType<SigningExtension>()?.apply {
val signingKey by auth {
it?.replace("\\n", "\n")
}
signingKey?.let {
val signingPassword by auth
useInMemoryPgpKeys(signingKey, signingPassword)
sign(extensions.findByType(PublishingExtension::class.java)!!.publications)
} ?: run {
isRequired = false
}
}

ktlint {
filter {
exclude("**/*Impl.kt")
exclude("**/example/**/*.kt")
}
}
Expand All @@ -172,8 +175,6 @@ subprojects {
tasks {
val configure: KotlinCompile.() -> Unit = {
kotlinOptions {
val JVM_TARGET_VERSION: String by project
jvmTarget = JVM_TARGET_VERSION
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ plugins {
`kotlin-dsl`
}
repositories {
jcenter()
mavenCentral()
}
11 changes: 7 additions & 4 deletions buildSrc/src/main/kotlin/Jar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.NamedDomainObjectProvider
import org.gradle.api.artifacts.Configuration
import org.gradle.api.file.CopySpec
import org.gradle.api.file.DuplicatesStrategy

fun Jar.fromConfiguration(configuration: NamedDomainObjectProvider<Configuration>, block: CopySpec.() -> Unit = {}) =
fromConfiguration(configuration.get(), block)
fun Jar.fromConfiguration(configuration: NamedDomainObjectProvider<Configuration>, block: CopySpec.() -> Unit = {
this.duplicatesStrategy = DuplicatesStrategy.INCLUDE
}) = fromConfiguration(configuration.get(), block)

fun Jar.fromConfiguration(configuration: Configuration, block: CopySpec.() -> Unit = {}) =
from(configuration.map { if (it.isDirectory) it else getProject().zipTree(it) }, block)
fun Jar.fromConfiguration(configuration: Configuration, block: CopySpec.() -> Unit = {
this.duplicatesStrategy = DuplicatesStrategy.INCLUDE
}) = from(configuration.map { if (it.isDirectory) it else project.zipTree(it) }, block)
58 changes: 0 additions & 58 deletions compiler-plugin/README.md

This file was deleted.

Loading