aspnetcore/clients/java/signalr/build.gradle

90 lines
2.8 KiB
Groovy

plugins {
id 'java'
id 'maven'
id "com.diffplug.gradle.spotless" version "3.14.0"
}
group 'com.microsoft.aspnet'
// If we're run from outside MSBuild, just assign a bogus dev version.
version project.findProperty('packageVersion') ?: "99.99.99-dev"
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testCompile 'org.junit.jupiter:junit-jupiter-params:5.3.1'
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
implementation "org.java-websocket:Java-WebSocket:1.3.8"
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
}
spotless {
java {
licenseHeader '// Copyright (c) .NET Foundation. All rights reserved.\n' +
'// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n\n' // License header
importOrder 'java', 'javax', 'org', 'com', 'com.diffplug', '' // A sequence of package names
replace 'Not enough space after if', 'if(', 'if ('
replace 'Not enough space after )', '){', ') {'
replace 'Not enough space after for', 'for(', 'for ('
replace 'Not enough space after while', 'while (', 'while ('
replace 'Not enough space after switch', 'switch(', 'switch ('
replaceRegex 'Too much space after if', 'if +\\(', 'if ('
trimTrailingWhitespace()
indentWithSpaces(4)
removeUnusedImports() // removes any unused imports
}
}
test {
useJUnitPlatform()
}
task sourceJar(type: Jar) {
classifier "sources"
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier "javadoc"
from javadoc.destinationDir
}
task generatePOM {
pom {
project {
inceptionYear '2018'
description 'ASP.NET Core SignalR Client for Java applications'
url 'https://github.com/aspnet/SignalR'
name groupId + ':' + artifactId
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
connection 'scm:git:git://github.com/aspnet/SignalR.git'
developerConnection 'scm:git:git://github.com/aspnet/SignalR.git'
url 'http://github.com/aspnet/SignalR/tree/master'
}
developers {
developer {
id 'microsoft'
name 'Microsoft'
}
}
}
}.writeTo("${buildDir}/libs/signalr-${project.version}.pom")
}
task createPackage(dependsOn: [jar,sourceJar,javadocJar,generatePOM])