Skip to content
This repository was archived by the owner on Jun 24, 2023. It is now read-only.

基本功能实现 #2

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
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
14 changes: 10 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

buildscript {
ext {
kotlinVersion = "1.4.21"
coroutinesVersion = "1.4.2"
r2dbcVersion = "0.8.3.RELEASE"
kotlinVersion = "1.6.10"
coroutinesVersion = "1.6.0"
r2dbcVersion = "0.9.1.RELEASE"
detektVersion = "1.12.0-RC1"
}
repositories {
Expand All @@ -14,6 +14,7 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${detektVersion}"
classpath "org.jetbrains.kotlinx:kotlinx-coroutines-reactive:${coroutinesVersion}"
}
}

Expand All @@ -27,7 +28,7 @@ subprojects { project ->
apply plugin: "maven-publish"
apply plugin: "com.jfrog.bintray"
apply plugin: "io.gitlab.arturbosch.detekt"
// apply from: "${project.rootDir}/check-source-header.gradle"
apply from: "${project.rootDir}/check-source-header.gradle"

repositories {
jcenter()
Expand Down Expand Up @@ -97,6 +98,11 @@ subprojects { project ->
name = "vince"
email = "[email protected]"
}
developer {
id = "lookup-cat"
name = "夜里的向日葵"
email = "[email protected]"
}
}
scm {
url = "https://github.com/kotlin-orm/ktorm-r2dbc.git"
Expand Down
49 changes: 49 additions & 0 deletions check-source-header.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

project.ext.licenseHeaderText = """/*
* Copyright 2018-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
"""

task checkCopyrightHeader {
doLast {
def headerLines = project.licenseHeaderText.readLines()

sourceSets.main.kotlin.srcDirs.each { dir ->
def tree = fileTree(dir)
tree.include("**/*.kt")

tree.visit {
if (!it.isDirectory()) {
def failed = false

it.file.withReader { reader ->
for (line in headerLines) {
if (line != reader.readLine()) {
failed = true
break
}
}
}

if (failed) {
throw new IllegalStateException("Copyright header not found in file: " + it.file)
}
}
}
}
}
}

check.dependsOn(checkCopyrightHeader)
Loading