Skip to content

Commit

Permalink
chore(build): upgrade to Gradle 7.5.1 (#312)
Browse files Browse the repository at this point in the history
* chore(build): plugins and script cleanup
* chore(build): upgrade to gradle 7.5.1
* chore(build): skip generated sources from spotless
  • Loading branch information
manikmagar committed Nov 14, 2022
1 parent 441cb7a commit ff3d57e
Show file tree
Hide file tree
Showing 10 changed files with 182 additions and 278 deletions.
96 changes: 8 additions & 88 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
/*
* This file was generated by the Gradle 'init' task.
*/
import org.gradle.crypto.checksum.Checksum
plugins {
id "java"
id "maven-publish"
id "application"
id "com.diffplug.gradle.spotless" version "4.3.0"
id "io.toolebox.git-versioner" version "1.6.7"
id "org.gradle.crypto.checksum" version "1.4.0"
id "com.github.breadmoirai.github-release" version "2.2.12"
id "de.fuerstenau.buildconfig" version "1.1.8"
id "com.geoffgranum.gradle-conventional-changelog" version "0.3.1"
id "com.github.gmazzo.buildconfig" version "3.1.0"
id "org.sonarqube" version "3.3"
id "jacoco"
}
Expand Down Expand Up @@ -68,6 +61,7 @@ spotless {
}
java {
importOrder 'java', 'javax', 'org', 'com', 'com.github.manikmagar', ''
targetExclude 'build/generated/**/*.*'
removeUnusedImports()
eclipse().configFile "eclipse-java-google-style.xml"
}
Expand All @@ -81,14 +75,6 @@ task versionTxt() {
distZip.dependsOn(versionTxt)
distTar.dependsOn(versionTxt)

task createChecksum(type: Checksum) {
dependsOn(assembleDist)
files = files([distZip, distTar].outputs.files.flatten())
outputDir = distZip.destinationDirectory.asFile.get()
algorithm = Checksum.Algorithm.SHA256
}
distZip.finalizedBy(createChecksum)

publishing {
publications {
maven(MavenPublication) {
Expand All @@ -113,77 +99,19 @@ versioner {
}

buildConfig {
clsName = 'BuildConfig' // sets the name of the BuildConfig class
packageName = 'com.javastreets.mulefd.app' // sets the package of the BuildConfig class,
charset = 'UTF-8' // sets charset of the generated class,
// 'UTF-8' if not set otherwise
}


task homebrew(type: Copy) {
dependsOn(createChecksum)
inputs.property('version', project.version)
from('src/main/scripts/brew/mulefd.rb')
into(buildDir.toString() + '/brew/formula')
doFirst { t ->
t.filter(org.apache.tools.ant.filters.ReplaceTokens,
tokens: [
projectVersion: project.version,
sha256 : new File(distZip.archiveFile.asFile.get().absolutePath + '.sha256').text
]
)
}
}

task container(type: Copy) {
dependsOn(createChecksum)
inputs.property('version', project.version)
from('src/main/scripts/container/')
include('*')
into(buildDir.toString() + '/container')
doFirst { t ->
t.filter(org.apache.tools.ant.filters.ReplaceTokens,
tokens: [
projectVersion: project.version,
sha256 : new File(distZip.archiveFile.asFile.get().absolutePath + '.sha256').text
]
)
}
}


task scoop(type: Copy) {
dependsOn(createChecksum)
inputs.property('version', project.version)
from('src/main/scripts/scoop/mulefd.json')
into(buildDir.toString() + '/scoop')
doFirst { t ->
t.filter(org.apache.tools.ant.filters.ReplaceTokens,
tokens: [
projectVersion: project.version,
sha256 : new File(distZip.archiveFile.asFile.get().absolutePath + '.sha256').text
]
)
}
buildConfigField('String', 'APP_NAME', "\"${project.name}\"")
buildConfigField('String', 'APP_VERSION', provider { "\"${project.version}\"" })
buildConfigField('long', 'BUILD_TIME', "${System.currentTimeMillis()}L")
packageName('com.javastreets.mulefd.app')
}

task tag(type: Exec) {
doFirst {
println 'Tagging with v' + project.version
commandLine 'git', 'tag', '-a', 'v' + project.version, '-F', 'CHANGELOG.md'
println 'Creating tag v' + project.version
commandLine 'git', 'tag', '-a', 'v' + project.version, '-m', 'Release v' + project.version
}
}

githubRelease {
token System.getenv("GITHUB_TOKEN") != null ? System.getenv("GITHUB_TOKEN") : "unknown_github_token" // This is your personal access token with Repo permissions
owner "manikmagar" // default is the last part of your group. Eg group: "com.github.breadmoirai" => owner: "breadmoirai"
repo "mulefd" // by default this is set to your project name
body "## News" // by default this is empty
draft true // by default this is false
allowUploadToExisting true // Reuse releases already drafted by release-drafter plugin
releaseAssets distZip.destinationDirectory.asFileTree.toList() // this points to which files you want to upload as assets with your release
}

compileJava {
options.encoding = 'UTF-8'
// options.compilerArgs << "-Xlint:unchecked"
Expand All @@ -194,8 +122,6 @@ compileTestJava {
// options.compilerArgs << "-Xlint:unchecked"
}



sonarqube {
properties {
property "sonar.projectKey", "manikmagar_mulefd"
Expand All @@ -205,12 +131,6 @@ sonarqube {
}
}


build.dependsOn(homebrew)
build.dependsOn(scoop)
build.dependsOn(container)


group = 'com.javastreets'
sourceCompatibility = '8'
targetCompatibility = '8'
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 2 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon Apr 06 22:08:14 EDT 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit ff3d57e

Please sign in to comment.