Skip to content

[Big one] Gradle #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
Closed
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
28 changes: 20 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,30 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
distributions: adopt
java-version: 11
check-latest: true
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: ./mvnw -B package --file pom.xml -Pscala-2.12

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

# - name: Cache Gradle packages
# uses: actions/cache@v2
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew build
# vim: ts=2:sts=2:sw=2:expandtab
33 changes: 33 additions & 0 deletions .github/workflows/generate_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Generate and publish docs

on:
push:
branches:
- "spark-3.2"

jobs:
generate-and-publish-docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
distributions: adopt
java-version: 11
check-latest: true

- name: Generate docs
run: ./gradlew dokkaHtml

- name: Copy docs to "docs" branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: docs
publish_dir: ./kotlin-spark-api/build/dokka/html
force_orphan: true


117 changes: 0 additions & 117 deletions .mvn/wrapper/MavenWrapperDownloader.java

This file was deleted.

2 changes: 0 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties

This file was deleted.

143 changes: 143 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
import java.net.URI

plugins {
val kotlinVersion: String by System.getProperties()
kotlin("jvm") version kotlinVersion

val licenseGradlePluginVersion: String by System.getProperties()
id("com.github.hierynomus.license") version licenseGradlePluginVersion

`maven-publish`
signing
}

val groupID: String by project
val projectVersion: String by project

group = groupID
version = projectVersion

repositories {
mavenCentral()
}

tasks.withType<Test>().configureEach {
useJUnitPlatform()
}

val javadocJar by tasks.registering(Jar::class) {
dependsOn("kotlin-spark-api:dokkaJavadoc")
archiveClassifier.set("javadoc")
from("kotlin-spark-api/build/dokka/javadoc")
}

val sourcesJar by tasks.registering(Jar::class) {
dependsOn("classes")
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}

artifacts {
archives(tasks["jar"])
archives(javadocJar)
archives(sourcesJar)
}



publishing {
publications {
create<MavenPublication>("mavenJava") {
artifact(sourcesJar) {
classifier = "sources"
}

artifact(javadocJar) {
classifier = "javadoc"
}

pom {
groupId = groupID
artifactId = "kotlin-spark-api-parent"
version = projectVersion

from(components["kotlin"])

name.set("Kotlin Spark API: Parent")
description.set("Parent project for Kotlin for Apache Spark")
packaging = "pom"

url.set("https://maven.apache.org")
inceptionYear.set("2019")

organization {
name.set("JetBrains")
url.set("https://www.jetbrains.com/")
}

licenses {
license {
name.set("Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}

developers {
developer {
id.set("asm0dey")
name.set("Pasha Finkelshteyn")
email.set("[email protected]")
timezone.set("GMT+3")
}
developer {
id.set("vitaly.khudobakhshov")
name.set("Vitaly Khudobakhshov")
email.set("[email protected]")
timezone.set("GMT+3")
}
developer {
id.set("Jolanrensen")
name.set("Jolan Rensen")
email.set("[email protected]")
timezone.set("GMT+1")
}
}

scm {
connection.set("scm:git:https://github.com/JetBrains/kotlin-spark-api.git")
url.set("https://github.com/JetBrains/kotlin-spark-api")
tag.set("HEAD")
}
}
}
}
repositories {
maven {
val snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
val releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
url = URI(if (projectVersion.endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
credentials {
val mavenCentralUsername: String by project
val mavenCentralPassword: String by project
username = mavenCentralUsername
password = mavenCentralPassword
}
}
}
}

val isReleaseVersion = !projectVersion.endsWith("SNAPSHOT")

tasks.withType<Sign> {
onlyIf {
isReleaseVersion && gradle.taskGraph.hasTask("publish")
}
}

signing {
setRequired { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
useGpgCmd()
sign(publishing.publications["mavenJava"])
}


Loading