From commits-return-12702-archive-asf-public=cust-asf.ponee.io@fineract.apache.org Wed Oct 14 12:07:05 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mailroute1-lw-us.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id AA68E18066D for ; Wed, 14 Oct 2020 14:07:04 +0200 (CEST) Received: from mail.apache.org (localhost [127.0.0.1]) by mailroute1-lw-us.apache.org (ASF Mail Server at mailroute1-lw-us.apache.org) with SMTP id D2A5A123E76 for ; Wed, 14 Oct 2020 12:07:03 +0000 (UTC) Received: (qmail 20731 invoked by uid 500); 14 Oct 2020 12:07:03 -0000 Mailing-List: contact commits-help@fineract.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@fineract.apache.org Delivered-To: mailing list commits@fineract.apache.org Received: (qmail 20664 invoked by uid 99); 14 Oct 2020 12:07:03 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Oct 2020 12:07:03 +0000 From: =?utf-8?q?GitBox?= To: commits@fineract.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bfineract=5D_vidakovic_commented_on_a_change_in_pul?= =?utf-8?q?l_request_=231402=3A_FINERACT-1189=3A_fineract_client_as_a_separa?= =?utf-8?q?te_module?= Message-ID: <160267722316.32230.8220301898789672804.asfpy@gitbox.apache.org> Date: Wed, 14 Oct 2020 12:07:03 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: vidakovic commented on a change in pull request #1402: URL: https://github.com/apache/fineract/pull/1402#discussion_r504612934 ########## File path: build.gradle ########## @@ -85,51 +218,235 @@ allprojects { trimTrailingWhitespace() } - if (plugins.hasPlugin('java')) { - java { - targetExclude '**/build/**', '**/bin/**', '**/out/**' - importOrder() //sort imports alphabetically - removeUnusedImports() - eclipse().configFile "$rootDir/config/fineractdev-formatter.xml" - endWithNewline() - trimTrailingWhitespace() - - // Enforce style modifier order - custom 'Modifier ordering', { - def modifierRanking = [ - public : 1, - protected : 2, - private : 3, - abstract : 4, - default : 5, - static : 6, - final : 7, - transient : 8, - volatile : 9, - synchronized: 10, - native : 11, - strictfp : 12] - // Find any instance of multiple modifiers. Lead with a non-word character to avoid - // accidental matching against for instance, "an alternative default value" - it.replaceAll(/\W(?:public |protected |private |abstract |default |static |final |transient |volatile |synchronized |native |strictfp ){2,}/, { - // Do not replace the leading non-word character. Identify the modifiers - it.replaceAll(/(?:public |protected |private |abstract |default |static |final |transient |volatile |synchronized |native |strictfp ){2,}/, { - // Sort the modifiers according to the ranking above - it.split().sort({ modifierRanking[it] }).join(' ') + ' ' - } - ) + lineEndings 'UNIX' + } + + // Configuration for Gradle license plug-in + // https://github.com/hierynomus/license-gradle-plugin + license { + header rootProject.file("$rootDir/APACHE_LICENSETEXT.md") + excludes([ + "**/git.properties", + "**/*.html", + "**/*.mustache", + "**/package-info.java", + "**/keystore.jks", + "**/static/swagger-ui/**", + "**/api-docs/**", + ]) + strictCheck true + } + + task licenseFormatBuildScripts (type:nl.javadude.gradle.plugins.license.License) { + source = fileTree(dir: "$rootDir/", includes: [ + '**/*.bat', + '**/*.sh', + '**/*.sql' + ]) + } + licenseFormat.dependsOn licenseFormatBuildScripts + + // Configuration for Apache Release Audit Tool task + // https://github.com/eskatos/creadur-rat-gradle + rat { + verbose = false + reportDir = file("$buildDir/reports/rat") + excludes = [ + '**/src/main/templates/**/*.mustache', + '**/.dockerignore', + '**/*.launch', + '**/licenses/**', + '**/*.md', + '**/*.github/**', + '**/MANIFEST.MF', + '**/*.json', + '**/*.json.template', + '**/*.txt', + '**/*.log', + '**/fineractdev-eclipse-preferences.epf', + '**/template-expected.html', + '**/template.mustache', + '**/.classpath', + '**/.project', + '**/.idea/**', + '**/*.ipr', + '**/*.iws', + '**/.settings/**', + '**/bin/**', + '**/.git/**', + '**/.gitignore', + '**/.gitkeep', + '**/*.iml', + '**/config/swagger/templates/**', + // Notice files + '**/NOTICE_RELEASE', + '**/NOTICE_SOURCE', + // Swagger License + '**/src/main/resources/static/swagger-ui/**', + // gradle + '**/.gradle/**', + '**/gradlew', + '**/gradlew.bat', + '**/gradle/wrapper/gradle-wrapper.properties', + '**/caches/**', + '**/daemon/**', + '**/native/**', + '**/wrapper/**', + '**/build/**', + // Api Docs + '**/api-docs/*.*', + '**/docs/system-architecture/.htaccess', + '**/docs/system-architecture/404.html', + '**/docs/system-architecture/index.html', + '**/docs/system-architecture/**/*.xml', + '**/bootstrap-3.0.0/assets/application.js', + '**/system-architecture/js/plugins.js', + // Apache License + '**/bootstrap-3.0.0/assets/less.js', + '**/css/bootstrap-3.0.0/**/*.*', + // Public Domain See http://www.JSON.org/js.html + '**/bootstrap-3.0.0/assets/json2.js.htm', + // MIT License + '**/modernizr-2.6.2.min.js', + '**/css/normalize.css', + '**/assets/filesaver.js', + '**/css/fonts/glyphicons-halflings-regular.svg', + '**/assets/jszip.js', + '**/assets/jquery.js', + '**/api-docs/jquery-1.7.min.js', + '**/css/toc-0.1.2/**/*.*', + '**/docs/system-architecture/css/main.css', + '**/system-architecture/js/vendor/jquery-1.9.1.min.js', + '**/system-architecture/js/vendor/toc-0.1.2/jquery.toc.min.js', + '**/assets/respond.min.js', + '**/assets/html5shiv.js', + // BSD License + '**/assets/uglify.js', + // Ignore out folder + '**/out/**', + // Git build info + "**/git.properties", + ] + } +} + +configure(project.fineractJavaProjects) { + // NOTE: order matters! + + apply plugin: 'java-library' + apply plugin: 'idea' + + /* define the valid syntax level for source files */ + sourceCompatibility = JavaVersion.VERSION_11 + /* define binary compatibility version */ + targetCompatibility = JavaVersion.VERSION_11 + + /* http://stackoverflow.com/questions/19653311/jpa-repository-works-in-idea-and-production-but-not-in-gradle */ + sourceSets.main.output.resourcesDir = sourceSets.main.java.outputDir + sourceSets.test.output.resourcesDir = sourceSets.test.java.outputDir + + sourceSets { + integrationTest { + compileClasspath += main.output + test.output + runtimeClasspath += main.output + test.output + } + } + + configurations { + implementation.setCanBeResolved(true) + api.setCanBeResolved(true) + + integrationTestCompile.extendsFrom testImplementation + integrationTestRuntime.extendsFrom testRuntime + } + + tasks.withType(JavaCompile) { + options.compilerArgs += [ + "-Xlint:unchecked", + "-Xlint:cast", + "-Xlint:auxiliaryclass", + "-Xlint:deprecation", + "-Xlint:dep-ann", + "-Xlint:divzero", + "-Xlint:empty", + "-Xlint:exports", + "-Xlint:fallthrough", + "-Xlint:finally", + "-Xlint:module", + "-Xlint:opens", + "-Xlint:options", + "-Xlint:overloads", + "-Xlint:overrides", + "-Xlint:path", + "-Xlint:processing", + "-Xlint:removal", + "-Xlint:requires-automatic", + "-Xlint:requires-transitive-automatic", + "-Xlint:try", + "-Xlint:varargs", + "-Xlint:preview", + "-Xlint:static", + // "-Werror" // TODO: @vidakovic fix this + ] + // TODO FINERACT-959 (gradually) enable -Xlint:all (see "javac -help -X") + + options.deprecation = true + + options.compilerArgs +=[ + "-Xmaxwarns", + 1500, + "-Xmaxerrs", + 1500 + ] + } + + // Configuration for the spotless plugin + // https://github.com/diffplug/spotless/tree/main/plugin-gradle + spotless { + java { + targetExclude '**/build/**', '**/bin/**', '**/out/**' + importOrder() //sort imports alphabetically + removeUnusedImports() + eclipse().configFile "$rootDir/config/fineractdev-formatter.xml" + endWithNewline() + trimTrailingWhitespace() + + // Enforce style modifier order + custom 'Modifier ordering', { + def modifierRanking = [ + public : 1, + protected : 2, + private : 3, + abstract : 4, + default : 5, + static : 6, + final : 7, + transient : 8, + volatile : 9, + synchronized: 10, + native : 11, + strictfp : 12] + // Find any instance of multiple modifiers. Lead with a non-word character to avoid + // accidental matching against for instance, "an alternative default value" + it.replaceAll(/\W(?:public |protected |private |abstract |default |static |final |transient |volatile |synchronized |native |strictfp ){2,}/, { + // Do not replace the leading non-word character. Identify the modifiers + it.replaceAll(/(?:public |protected |private |abstract |default |static |final |transient |volatile |synchronized |native |strictfp ){2,}/, { + // Sort the modifiers according to the ranking above + it.split().sort({ modifierRanking[it] }).join(' ') + ' ' } ) } - } - - if (project.hasProperty("automatedBuild")) { - dependsOn(spotlessCheck) - } else { - dependsOn(spotlessApply) + ) } } + // TODO: @vidakovic why do we need this again? Spotless is checking anyway + // if (project.hasProperty("automatedBuild")) { + // dependsOn(spotlessCheck) + // } else { + // dependsOn(spotlessApply) + // } Review comment: Ok, understood. Then I have to move this most likely somewhere else. As is, it complains about spotlessApply not being available. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org