Skip to content
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

Add validate plugin check #22

Open
wants to merge 4 commits into
base: main
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
19 changes: 9 additions & 10 deletions .github/workflows/manual-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,31 @@ on:
workflow_dispatch:

jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out code
uses: actions/checkout@v2
uses: actions/[email protected]
with:
fetch-depth: '0'

- name: Set up environment
run: |
echo "${{ secrets.GRADLE_PUBLISH_KEY }}" >> ~/.gradle/gradle.properties
echo "${{ secrets.GRADLE_PUBLISH_SECRET }}" >> ~/.gradle/gradle.properties

- name: Check out java
uses: actions/setup-java@v1
- name: Setup java
uses: actions/setup-java@v2.5.0
with:
java-version: 1.11
distribution: 'adopt'
java-version: 11

- name: Run verifications
run: ./gradlew detekt ktLintCheck test
run: ./gradlew check

- name: Upload reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.3.1
if: failure()
with:
name: Reports
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,26 @@ on:
branches: [ develop ]

jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out code
uses: actions/checkout@v2
uses: actions/[email protected]
with:
fetch-depth: '0'

- name: Check out java
uses: actions/setup-java@v1
- name: Setup java
uses: actions/setup-java@v2.5.0
with:
distribution: 'adopt'
java-version: 11

- name: Run verifications
run: ./gradlew detekt ktLintCheck test
run: ./gradlew check

- name: Upload reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.3.1
if: failure()
with:
name: Reports
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Plugin published [here](https://plugins.gradle.org/plugin/se.eelde.build-optimiz
##### Use it
```kotlin
plugins {
id("se.eelde.build-optimizations") version "0.1.1"
id("se.eelde.build-optimizations") version "0.2.0"
}
```

Expand All @@ -23,7 +23,7 @@ plugins {
```kotlin
buildscript {
dependencies {
classpath("se.eelde.build-optimizations:se.eelde.build-optimizations.gradle.plugin:0.1.1")
classpath("se.eelde.build-optimizations:se.eelde.build-optimizations.gradle.plugin:0.2.0")
}
}

Expand All @@ -49,3 +49,4 @@ Checks are [here](src/main/java/se/eelde/build_optimization/Check.kt)
* Default File encoding
* Require a specific setting of jvmXmx (default -Xmx=2g)
* Require a specific setting of jvmXms (default -Xms=500m)
* Require file system watcher to be enabled after gradle 6.5
39 changes: 19 additions & 20 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,53 +1,52 @@
plugins {
id("com.github.ben-manes.versions") version "0.36.0"
id("com.github.ben-manes.versions") version "0.41.0"
id("java")
id("java-gradle-plugin")
id("com.gradle.plugin-publish") version "0.12.0"
id("org.jetbrains.kotlin.jvm") version "1.4.21"
id("com.gradle.plugin-publish") version "0.20.0"
id("org.jetbrains.kotlin.jvm") version "1.6.10"
id("maven-publish")
id("signing")
// use this dependency to run plugin from plugin repository
// id("se.eelde.build-optimizations") version "0.1.2"
id("org.jlleitschuh.gradle.ktlint") version "9.4.1"
id("io.gitlab.arturbosch.detekt") version "1.14.2"
// id("se.eelde.build-optimizations") version "0.2.0"
id("io.gitlab.arturbosch.detekt") version "1.19.0"
}

buildscript {
// use this dependency to run plugin locally
// dependencies {
// classpath("se.eelde.build-optimizations:se.eelde.build-optimizations.gradle.plugin:0.1.3-SNAPSHOT")
// classpath("se.eelde.build-optimizations:se.eelde.build-optimizations.gradle.plugin:0.2.0")
// }
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
}

allprojects {
repositories {
jcenter()
mavenCentral()
}
}

detekt {
autoCorrect = true
buildUponDefaultConfig = true
config = files("$projectDir/config/detekt/detekt.yml")

reports {
html.enabled = true
}
}

dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.14.2")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.19.0")
}

detekt {
autoCorrect = true
}

// apply(plugin= "se.eelde.build-optimizations")
//apply(plugin = "se.eelde.build-optimizations")

//buildOptimization {
// jvmXmx = "2GB"
// jvmXms = "500MB"
//}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
Expand All @@ -66,12 +65,12 @@ tasks.withType<Test> {
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.4.21")
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.10")
implementation(gradleApi())
testImplementation(gradleTestKit())
testImplementation("com.google.truth:truth:1.1")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0")
testImplementation("com.google.truth:truth:1.1.3")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2")
}

// Use java-gradle-plugin to generate plugin descriptors and specify plugin ids
Expand Down
Loading