http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/build.gradle.sav ---------------------------------------------------------------------- diff --git a/build.gradle.sav b/build.gradle.sav deleted file mode 100644 index 450a54c..0000000 --- a/build.gradle.sav +++ /dev/null @@ -1,930 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ - -apply from: 'gradle/wrapper.gradle' -apply from: 'gradle/other.gradle' - -import org.gradle.plugins.signing.Sign -import java.io.Console - -/* Configure root project */ -allprojects { - apply plugin: 'idea' - apply plugin: 'eclipse' - - repositories { - mavenCentral() - } - - project.version = build_version -} - -apply from: 'gradle/rat.gradle' - -rat { - excludes = [ - '*.patch', - '**/.classpath', - '**/.cache/**', - '**/.git/**', - '**/.gitignore', - '**/.gradle/**', - '.gradle-wrapper/**', // historical instead of gradle/wrapper - '**/.idea/**', - '**/.project', - '**/.settings/**', - '**/bin/**', // generated by Eclipse builds - '**/build/**', - '**/META-INF/services/**', - '**/README.md', - 'externalJars/**', // generated by setupExternalJars for Eclipse use - 'gradlew', - 'gradlew.bat', - 'DEVELOPMENT.md', - 'JAVA_SUPPORT.md', - 'CONTRIBUTORS', '.mailmap', - 'binary-release/apache-notice', - 'binary-release/ibm-contrib-notice', - 'connectors/jdbc/JdbcStreamsTestDb/**', - 'connectors/jdbc/derby.log', - 'connectors/mqtt/src/test/keystores/**', - 'console/**/js/ext/**/jquery.js', // has header w/MIT license ref - 'console/**/js/ext/**/jquery-ui.min.css', // has header w/MIT license ref - 'console/**/js/ext/**/jquery-ui.min.js', // has header w/MIT license ref - 'console/**/js/ext/**/jquery-ui.structure.min.css', // has header w/MIT license ref - 'console/**/js/ext/**/jquery-ui.theme.min.css', // has header w/MIT license ref - 'console/**/js/ext/d3.legend.js', // has header w/MIT license ref - 'console/**/js/ext/d3.min.js', // no header. included in LICENSE - 'console/**/js/ext/sankey_edgent.js', // no header. included in LICENSE - 'licenses/d3-sankey.BSD', // OK, BSD 3-clause - 'licenses/d3.BSD', // OK, BSD 3-clause - 'licenses/binary-release/javax.servlet-api-3.1.0.CDDL-1.0', // OK, only binary form content - 'licenses/binary-release/javax.websocket-api-1.0.CDDL-1.1', // OK, only binary form content - 'licenses/binary-release/mqttv3-1.1.0.EDL-1.0', // OK, EDL-1.0 - 'licenses/binary-release/mqttv3-1.1.0.EDL-1.0', // OK, EDL-1.0 - 'licenses/binary-release/watson-iot-0.2.2.EPL-1.0', // OK, only binary form content - 'samples/**/*.properties', - 'samples/**/*.cfg', - 'scripts/**/*.properties', - 'scripts/**/*.cfg', - 'scripts/connectors/jdbc/persondata.txt', - 'scripts/connectors/kafka/README-kafka', - 'test/**/*.properties', - 'test/**/device.cfg', - 'test/**/*.txt', - ] -} - -apply plugin: 'java' -jar { - deleteAllActions() // Avoid creating/staging an empty jar for the "root" -} -apply plugin: 'signing' - - -ext { - commithash_error = '' - commithash = { - try { - return "git rev-parse --short HEAD".execute().text.trim() - } catch (Exception e) { - ext.commithash_error = e - return '' - } - }() - now = new Date() - DSTAMP = String.format('%tY%<tm%<td', now) - TSTAMP = String.format('%tH%<tM', now) - COPYRIGHT_YEAR = String.format('%tY', now) - - snapshotId = "-SNAPSHOT-${DSTAMP}-${TSTAMP}" - if (System.properties['edgent.snapshotId'] != null) { - snapshotId = System.properties['edgent.snapshotId'] - } - - external_jars_dir = "$rootProject.projectDir/externalJars/java8" - - target_dir = "$distsDir" - target_java8_dir = "$target_dir/java8" - target_java8_ext_dir = "$target_java8_dir/ext" - target_java7_dir = "$target_dir/java7" - target_android_dir = "$target_dir/android" - target_docs_dir = "$target_dir/docs" - target_javadoc_dir = "$target_docs_dir/javadoc" - target_report_dir = "$target_dir/reports" - - // project groups whose jars are to be placed in target_java8_lib - // instead of the default "$target_java8_dir/$simpleProjectGroup/$project.name/lib" - // e.g., "$target_java8_dir/lib" for api/topology - // "$target_java8_dir/connectors/iotp/lib" for connectors/iotp - // - target_java8_lib_groups = ["api", "providers", "runtime", "spi"] - - // TODO can these be deduced by the absence of a build.gradle for the project? - aggregatorOnlyProjects = [ - ':android', - ':analytics', ':api', ':apps', - ':connectors', ':console', - ':platform', ':providers', - ':runtime', ':samples', ':spi', - ':test', ':utils' - ] - - filteredSubprojects = subprojects.findAll { - project -> !aggregatorOnlyProjects.contains(project.path) - } - - // Edgent core external dependencies - core_ext_dependencies = ['com.google.code.gson:gson:2.2.4', - 'org.slf4j:slf4j-api:1.7.12', - 'io.dropwizard.metrics:metrics-core:3.1.2'] - - // Edgent Samples external dependencies - samples_ext_dependencies = ['org.slf4j:slf4j-jdk14:1.7.12'] - - // Edgent tests external dependencies - test_common_dependencies = ['org.slf4j:slf4j-jdk14:1.7.12'] - - common_ext_dependencies = [ - core_ext_dependencies, - samples_ext_dependencies, - // test_common_dependencies, // omit as tests aren't included in release tgz - ].flatten() - - ext."signing.keyId" = null - ext."signing.secretKeyRingFile" = null - ext."signing.password" = null -} - -// Declare the common_ext_dependencies as dependencies of the root project -// to easily copy them (their resolved paths) to the target dir -dependencies { - compile common_ext_dependencies -} -ext.copyCommonExtJarsFn = { targetDir -> - copy { - from configurations.compile.files - into targetDir - } -} -task setupCommonExtJars << { - copyCommonExtJarsFn "$external_jars_dir/ext" -} -task copyCommonExtJars << { - copyCommonExtJarsFn target_java8_ext_dir -} - -def String mkJarNameFromSpec(String jarSpec) { - // e.g. 'com.google.code.gson:gson:2.2.4' => gson-2.2.4.jar - // e.g. 'com.google.code.gson:gson:2.2.4@jar' => gson-2.2.4.jar - def sfx = jarSpec.endsWith('@jar') ? "" : '.jar' - return jarSpec.split(':')[1] + '-' + jarSpec.split(':')[2].replace('@','.') + sfx -} - -def getProjectExtDepFiles(Project proj) { // project's direct ext deps and their transitive deps - // TODO suspect this is picking up ext dependencies of transitive **project** dependencies??? - - // handle ext jar deps expressed via "compile <external-dependency-spec>" - def allExtDepFiles = proj.configurations.runtime.files { it instanceof ExternalDependency } - - // handle ext jar deps expressed via addTargetDirExtJarDependency - allExtDepFiles.addAll proj.files(proj.directTargetDirExtJarDependencies) - - logger.info "$proj.path allExtDepFiles: "+allExtDepFiles - return allExtDepFiles -} - -def getProjectNonCommonExtDepFiles(Project proj) { - // filter out "common" (target_java8_ext_dir) external dependencies - def commonExtJarNames = common_ext_dependencies.collect { - mkJarNameFromSpec it - } - def filteredExtDepFiles = getProjectExtDepFiles(proj).findAll { - ! commonExtJarNames.contains(it.getName()) - } - return filteredExtDepFiles -} - -def String mkManifestClassPath(Project proj) { - // The manifest's classpath needs to include the project's: - // - immediate-only dependant edgent jars (not transitive and not their ext deps - // since our project jars are build with a manifest-classpath that - // handles the project's "private" dependencies) - // - immediate dependant external jars and their transitive deps (since - // these don't seem to have a manifest classpath that takes care of their - // dependencies) - // - common_ext_dependencies jars when declared as dependencies - // - // proj.configurations.runtime.files (mostly) captures all of the above - // since do to our project build.gradle use of our various add*Dependency(). - - def depJars = proj.configurations.runtime.files - - // assume that any deps still in the gradle cache are project private ext deps - // (that will-get/have-been copied into the project's ext dir in the targetdir) - def projExtDir = "$target_java8_dir/$proj.targetRelProjExtDir" - depJars = depJars.collect { file -> - if (file.toString().contains('/.gradle/caches/')) { - return proj.file("$projExtDir/"+file.getName()) - } - return file - } - - def cp = proj.mkRelativePaths(depJars).join(' ') - logger.info "$proj.path manifest-classPath: $cp" - return cp -} - -gradle.taskGraph.whenReady {taskGraph -> - if (taskGraph.hasTask(test)) { - println "\nHINTs: Use the '--tests <testClassNamePattern>[.<testMethodNamePattern>]' option to select specific test classes or methods." - println " ./gradlew :api:topology:test --tests '*JsonFunctionsTest'" - println " ./gradlew :api:topology:test --tests '*JsonFunctionsTest.testBytes'" - println "Use the 'cleanTest' task to force a rerun of a previously successful test task:" - println " ./gradlew :api:topology:cleanTest :api:topology:test" - println " ./gradlew cleanTest test" - println "" - sleep 2 - } -} - -/* Configure subprojects */ -subprojects { - - // ignore aggregator only projects so we don't assemble empty jars, etc for them. - if (aggregatorOnlyProjects.contains(project.path)) { - return - } - - if(!project.group.equals("edgent.platform")){ - apply plugin: 'maven-publish' - } - apply plugin: 'java' - apply plugin: "jacoco" - - if (buildFile.isFile() && !buildFile.exists()) { - configurations.create('default') - return - } - - ext.simpleGroupName = project.group.replace('edgent.', '') // e.g., 'edgent.api' => 'api' - - ext.mkRelativePaths = { Collection files -> - // make all files paths relative to the project's lib dir in targetdir - // well... unless this is for a war, which resides in the group's "webapps" - // dir instead of project's lib dir. See :console:servlets build.gradle. - def projLibDir = project.file("$target_java8_dir/$targetRelProjLibDir") - if (project.pluginManager.hasPlugin('war')) { - projLibDir = project.file("$target_java8_dir/$project.simpleGroupName/webapps") - } - files.collect { projLibDir.toPath().relativize(it.toPath()) } - } - - ext.targetRelProjDir = { String kind -> // kind: "lib", "ext" - // use targetRelProject{Lib,Ext}Dir - // e.g., => "lib" or "<component>/<subcomponent>/lib" - // the general case location - def relProjDir = "$simpleGroupName/$project.name/$kind" - - // special cases - if (target_java8_lib_groups.contains(simpleGroupName)) { - relProjDir = "$kind" - } - else if ('samples' == simpleGroupName) { - relProjDir = "samples/$kind" - } - - return relProjDir - } - ext.targetRelProjLibDir = targetRelProjDir('lib') - ext.targetRelProjExtDir = targetRelProjDir('ext') - - // N.B. regarding the various add*Dependency() methods - // - // The methods need to be used in project build.gradle "dependencies" declarations. - // e.g., - // dependencies { - // addTargetDirProjectJarDependency 'compile', ':api:topology' # NOT compile project(':api:topology') - // addProjectExtDependency 'compile', 'com.ibm.messaging:watson-iot:0.2.2' # NOT compile 'com.ibm.messaging:watson-iot:0.2.2' - // addProjectExtDependency 'compile', 'org.apache.kafka:kafka_2.10:0.8.2.2@jar' - // addTargetDirCoreExtDependencies 'compile' - // addMyTargetDirProjectJarDependency 'testCompile' - // // N.B. root project adds test common dependencies - // } - // - // These methods play a role in the policies: - // - Edgent projects depend on other project's jars in the target-dir, not their classes - // - Edgent project jars have a manifest-classpath that handles - // the project's "private" inter-project dependencies - // as well as the project's "private" external component dependencies. - // - We build a target dir that includes the project's jar as well as - // the project's external dependency jars - // - The tests compile and run against the project jars in the target dir - // (as external/integration test code would). - // - The samples compile and run against the project jars in the target dir - // (as user code would). - - ext.directTargetDirExtJarDependencies = [] - - ext.addTargetDirProjectJarDependency = { config,proj -> - // add a dependency on a project's jar in the target-dir - def jarPath = project(proj).jar.archivePath - - // add the jar as a dependency and ensure it's present when we need it - // ? script error with: dependencies { "$config" files(jarPath) builtBy "${proj}:assemble" } - dependencies { "$config" files(jarPath) } - def task = "${config}Java" - if (config == "testCompile") { - task = "compileTestJava" - } - else if (config == "providedCompile") { - task = "compileJava" - } - "$task" { dependsOn "${proj}:assemble" } - } - - ext.addMyTargetDirProjectJarDependency = { config -> - // add a dependency on my project's jar in the target dir - addTargetDirProjectJarDependency(config, project.path) - } - - ext.addTargetDirExtJarDependency = { config,jarName -> - // add a dependency on a target_java8_ext_dir jarName - // record the addition - def jar = "$target_java8_ext_dir/$jarName" - if (!directTargetDirExtJarDependencies.contains(jar)) { - directTargetDirExtJarDependencies.add jar - } - - // add the jar as a dependency - dependencies { "$config" files(jar) } - compileJava { dependsOn ':copyCommonExtJars' } - } - - ext.addTargetDirCoreExtJarDependencies = { config -> - core_ext_dependencies.collect { depSpec -> - mkJarNameFromSpec(depSpec) - }.each { jarName -> - addTargetDirExtJarDependency config, jarName - } - } - - ext.addProjectExtDependency = { config,externalDepSpec -> - // for declaring project private external dependencies - // ends up (transitively) copying the dependency to the project's ext dir - dependencies { "$config" externalDepSpec } - } - - ext.addCompileTestDependencies = { String... deps -> - // add a dependency on other project's testClasses - deps.each { dep -> - dependencies { - testCompile project(dep).sourceSets.test.output - } - compileTestJava { - dependsOn "${dep}:testClasses" - } - } - } - - sourceCompatibility = '1.8' - targetCompatibility = '1.8' - - def compileOptions = { - options.debugOptions.debugLevel = 'source,lines,vars' - options.verbose = logger.isDebugEnabled() - options.listFiles = logger.isInfoEnabled() - options.deprecation = true - options.encoding = 'UTF-8' - } - compileJava { - configure compileOptions - } - compileTestJava { - configure compileOptions - } - - dependencies { - // common dependencies for tests - testCompile 'junit:junit:4.10' - addMyTargetDirProjectJarDependency 'testCompile' - if (project.path != ':api:function') { - addTargetDirExtJarDependency 'testRuntime', 'slf4j-jdk14-1.7.12.jar' - } - else { - // the add... induces UnsupportedOperationException elsewhere in script when processing :api:function:jar ??? - // can't figure it out but cleaning directTargetDirExtJarDependencies - // avoids it ???... with seemingly no other consequences. - addTargetDirExtJarDependency 'testRuntime', 'slf4j-jdk14-1.7.12.jar' - project.directTargetDirExtJarDependencies = [] - } - - // common dependencies for samples - if (project.path ==~ '^:samples.*') { - addTargetDirProjectJarDependency 'compile', ':providers:development' - addTargetDirProjectJarDependency 'compile', ':providers:direct' - - addTargetDirCoreExtJarDependencies 'compile' - addTargetDirExtJarDependency 'runtime', 'slf4j-jdk14-1.7.12.jar' - } - } - - ext.copyProjectExtJarsFn = { targetDir -> - // Copy the project jar's "private" external dependencies (transitively) - // into the project's ext dir in the target-dir. - - // If our project's jar task lacks any actions (e.g., platform:android) - // there's nothing to do. - if (!jar.actions) - return - - // FYI we're getting more transitive ext deps than the ant build - // in some cases - e.g., for watson iot we "knew" we only needed a subset - // of all watson iot deps known to maven - - def projectExtDir = project.targetRelProjExtDir - def nonCommonExtFiles = getProjectNonCommonExtDepFiles(project) - logger.info "$project.path copying projExtDepFiles jars: "+nonCommonExtFiles.collect { it.getName() } - copy { - from nonCommonExtFiles - includeEmptyDirs = false - into "$targetDir/$projectExtDir" - } - } - - ext.copyProjectExtJarsFn2 = { targetDir -> - // Copy the project jar's "private" external dependencies (transitively) - // into target-dir. - - def nonCommonExtFiles = getProjectNonCommonExtDepFiles(project) - logger.info "$project.path copying projExtDepFiles jars: "+nonCommonExtFiles.collect { it.getName() } - copy { - from nonCommonExtFiles - includeEmptyDirs = false - into "$targetDir" - } - } - - task setupProjectExtJars << { - // Helper for setupExternalJars task - copyProjectExtJarsFn external_jars_dir - } - - jar { - // adjust jar task config and also augment the task to do our additional processing - - // generate the project's jar into the target dir location - // with the appropriate name and manifest. - // TODO - gradle/maven best practice has version in jarname - - archiveName = "${project.group}.${project.name}.${extension}" - if (["javax.websocket-client", "javax.websocket-server", "edgent.javax.websocket"].contains(project.name)) { - archiveName = "${project.name}.${extension}" - } - destinationDir = file("$target_java8_dir/" + targetRelProjLibDir) - - doFirst { - configure jarOptions - } - - doLast { - copyProjectExtJarsFn target_java8_dir - } - } - - ext.jarOptions = { - manifest { - attributes( - 'Implementation-Title': "${-> baseName}", - 'Implementation-Vendor': build_vendor, - // TODO inclusion of DSTAMP/TSTAMP results in regeneration - // of a jar when none of its contents/dependencies have changed. - // If possible use a canned DSTAMP/TSTAMP for non-"release" tasks - // to make the dev cycle more efficient at the expense of the TSTAMP. - 'Implementation-Version': "${commithash}-${DSTAMP}-${TSTAMP}", - 'Class-Path': mkManifestClassPath(project), - ) - } - metaInf { - with( copySpec { - rename { 'LICENSE' } - from rootProject.file('binary-release/apache-v2_0-license') - }) - with( copySpec { - rename { 'NOTICE' } - from rootProject.file( - projectsWithPreApacheContribs.contains(project.path) - ? 'binary-release/ibm-contrib-notice' - : 'binary-release/apache-notice') - }) - } - } - - ext.printFile = { path -> - ant.concat { fileset(file: path) } - } - ext.adjustTest7Classpath = false - - task testSummaryFinalizer << { - def testTask = tasks.getByName('test') - if (System.properties['edgent.build.ci'] != null) { - testTask.failedTestResultPaths.each { path -> - println path - printFile path - } - } - def result = testTask.summaryResult - if (result != null) { - def duration = String.format('%.3fsec', (result.endTime - result.startTime) / 1000) - println "$project.path $duration $result.resultType ($result.testCount tests, $result.failedTestCount failures, $result.skippedTestCount skipped)" - } - } - - test { - filter { - includeTestsMatching '*Test' // can override via --tests command line option - } - - systemProperty 'edgent.test.top.dir.file.path', rootProject.projectDir - systemProperty 'edgent.test.root.dir', rootProject.projectDir - systemProperty 'edgent.build.ci', System.properties['edgent.build.ci'] - - // pass along any org.apache.edgent system props - systemProperties System.properties.findAll { it.key.startsWith("org.apache.edgent") } - - testLogging { - exceptionFormat 'full' - showStandardStreams = System.properties['edgent.test.showOutput'] != null - } - beforeSuite { desc -> - if (!desc.parent) { // will match the outermost suite - println "$project.path testing ..." - } - } - ext.failedTestResultPaths = [] - ext.summaryResult = null - afterSuite { desc, result -> - // make failures in edgent.build.ci runs more debuggable - // wish the junit xml files existed at this moment but they don't - if (desc.parent && desc.className != null) { // individual test class result - if (result.resultType == TestResult.ResultType.FAILURE) { - def resultFile = "$testResultsDir/test/TEST-${desc.className}.xml" - println "\nFailed testrun results: $resultFile" - failedTestResultPaths.add resultFile - } - } - else if (!desc.parent) { // project's overall results - summaryResult = result - } - } - finalizedBy "testSummaryFinalizer" // a doLast isn't invoked if there's a test failure - reports { - junitXml.enabled = true // generate build/test-results/test/TEST-*.xml - // individual <project>/build/reports junit/jacoco html reports not needed with aggregate report - html.enabled = System.properties['edgent.test.project.htmlReports'] != null - } - doFirst { - // The project's tests are supposed to run against its target-dir jar. - // We must remove the project's $buildDir/{classes,resources}/main - // from the classpath so they're not used. - - classpath = project.sourceSets.test.runtimeClasspath - classpath -= project.sourceSets.main.output - - // Hmm... for some reason the classpath (when printed here) also includes - // the project's src build/libs/ jar and by the default name - // (e.g., build/libs/oplets-0.4.1.jar) yet we've configured the jar task - // to generate the jar in the target-dir with a different name. - // It also lacks that target-dir jar we added as a dependency - // via addMyTargetDirProjectJarDependency 'testCompile' - // ??? - // Adjust accordingly. - - classpath = classpath.filter { ! it.path.startsWith(project.libsDir.path) } - classpath = files(project.jar.archivePath) + classpath - - if (adjustTest7Classpath) { - // Add special java7 processing... (on top of the other test.doFirst classpath manipulations) - - // Change from using the normal test classes dir to the java7 test classes dir - classpath -= files(sourceSets.test.output.classesDir) - classpath = files(sourceSets.test.output.classesDir.toString().replace('test', 'java7Test')) + classpath - - // Some of the tests have dependencies on other tests, adjust those classpaths too - classpath = files(classpath.collect { it.toString().replace('build/classes/test', 'build/classes/java7Test') }) - - // Switch from java8 jars to java7 jars - classpath = files(classpath.collect { it.toString().replace('java8', 'java7') }) - } - logger.debug "$project.path test.classpath: " + classpath.collect { it.toString() } - } - } - - ext.j7TestClassesDir = file("$project.buildDir/classes/java7Test") - - task test7AdjustTestTask << { - if (! tasks.getByName('test').enabled - || unsupportedJava7TestProjects.contains(project.path) - || sourceSets.test.allSource.isEmpty()) { - test.enabled = false - return - } - adjustTest7Classpath = true - if (!j7TestClassesDir.exists()) { - // implicit dependency: :platform:java7:test7Compile - logger.error " ERROR: Run the test7Compile task. $j7TestClassesDir does not exist." - throw new TaskExecutionException() - } - test { - testClassesDir = j7TestClassesDir - outputs.upToDateWhen { false } // always run - task is never "up to date" - } - } - - task test7Run() { - description = "Run the test7Compile'd tests against the java7 target jars - run after :platform:java7:test7Compile and with JAVA_HOME==java7-VM" - // fwiw trying to leverage :platform:java7:ant_test7.run was problematic - - dependsOn ':platform:java7:verifyJava7Built', test7AdjustTestTask, test - // implicit dependency: :platform:java7:test7Compile - test.mustRunAfter = [ test7AdjustTestTask, ':platform:java7:verifyJava7Built' ] - - outputs.upToDateWhen { false } // always run - never "up to date" - } - - assemble.doLast { - // augment assemble with our additional target dir update processing - - // Copy SRC into target dir when appropriate - if (project.path ==~ '^:samples.*') { - copy { - from(sourceSets.main.allSource.srcDirs) { include '**/*.java' } - into "$target_java8_dir/$project.simpleGroupName/src/$project.name/src/main/java/" - } - } - } - - task sourceJar(type: Jar) { - // baseName-appendix-version-classifier.extension - from sourceSets.main.allJava - classifier = 'sources' - } - - // support for 'gradle publishToMavenLocal' etc - // TODO publishing test.{fvt,svt} and samples ... doesn't seem desirable? e.g., we're excluding test.{fvt,svt} jars from the tgz - if (project.pluginManager.hasPlugin('publishing')) { - publishing { - publications { - mavenJava(MavenPublication) { - // specify dependencies like: org.apache.edgent:edgent.api.topology:0.4.0 - groupId = build_group - artifactId = "${project.group}.${project.name}" - artifact sourceJar - if (project.pluginManager.hasPlugin('war')) { - from components.web - } - else { - from components.java - } - } - } - } - } - -} - -task copyScripts(type: Copy) { - description = 'Copy scripts to target_java8_dir' - includeEmptyDirs = false - from("scripts/") { include "**/*" } - into "$target_java8_dir/scripts/" -} - -//Create Junit Report -// need to setup classpath to junit/jacoco for ant.junitreport task -configurations { - junitLibs -} -dependencies { // versions with gradle 3.1 - junitLibs 'org.apache.ant:ant-junit:1.9.6' - junitLibs 'org.apache.ant:ant-junit4:1.9.6' - junitLibs 'org.jacoco:org.jacoco.ant:0.7.7.201606060606' -} - -task createJunitReport << { - description = "Generates a Junit report from all subprojects (use after 'test')" - - ant.delete(dir: "${target_report_dir}/tests") - ant.taskdef(name: 'junitreport', - classname: 'org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator', - classpath: configurations.junitLibs.asPath) - ant.junitreport(todir: './') { - fileset(dir: './', includes: '**/test-results/test/TEST-*.xml') - report(format: 'frames', todir: "${target_report_dir}/tests") - } - ant.move(file: "TESTS-TestSuites.xml", tofile: "${target_report_dir}/TESTS-TestSuites.xml") -} - -apply from: 'gradle/jacoco.gradle' -apply from: 'gradle/javadoc.gradle' - -task addVersionDotTxt { - description = 'Add version.txt in target_dir' - doLast { - def map = [ - DSTAMP: "$DSTAMP", - TSTAMP: "$TSTAMP", - commithash: "$commithash", - 'commithash.error': "$commithash_error", - 'edgent.version': "$build_version", - ] - def f = new File("$target_dir/version.txt"); - def d = new File(target_dir); - if( !d.exists() ) { d.mkdirs() } - f.createNewFile() - map.forEach { k,v -> f.append "$k=$v\n" } - } -} - -task releaseTarGz(type: Tar) { - description = 'Create binary release tgz in target_dir' - archiveName = "apache-${build_name}-${build_version}-incubating${snapshotId}-bin.tgz" - compression = Compression.GZIP - destinationDir = new File("${target_dir}/../release-edgent") - duplicatesStrategy 'exclude' - into "${build_name}-${build_version}${snapshotId}" - // make some things first in the tgz - from rootProject.file('binary-release/LICENSE') - from rootProject.file('binary-release/NOTICE') - into ('licenses') { from 'licenses' } - from 'DISCLAIMER', 'JAVA_SUPPORT.md' - from rootProject.file('binary-release/README') - from 'RELEASE_NOTES', 'CONTRIBUTORS' - from "$target_dir/version.txt" - from target_dir - exclude '**/test/svt/' - exclude '**/connectors/javax.websocket-server/' // just part of wsclient test harness - doLast { - ant.checksum algorithm: 'md5', file: archivePath - ant.checksum algorithm: 'sha-512', fileext: '.sha', file: archivePath - println "created $destinationDir/$archiveName" - } -} - -task srcReleaseTarGz(type: Tar) { - description = 'Create source release tgz in target_dir' - archiveName = "apache-${build_name}-${build_version}-incubating${snapshotId}-src.tgz" - compression = Compression.GZIP - destinationDir = new File("${target_dir}/../release-edgent") - duplicatesStrategy 'exclude' - into "${build_name}-${build_version}${snapshotId}-src" - // make some things first in the tgz - from 'LICENSE', 'NOTICE' - from 'DISCLAIMER', 'JAVA_SUPPORT.md' - from 'RELEASE_NOTES' - from 'README' - exclude 'README.md' - from 'DEVELOPMENT.md' - from '.' - exclude 'KEYS' - exclude '.git', '.gradle', '.settings' - exclude '.gradle-wrapper', 'gradlew', 'gradlew.bat' - exclude '**/build/' // gradle generated artifacts - exclude '**/externalJars/' // gradle generated artifacts for eclipse - exclude '**/bin/' // eclipse generated artifacts - exclude '**/*.class' // final backstop just in case - exclude 'connectors/jdbc/derby.log' // test cruft - exclude 'connectors/jdbc/JdbcStreamsTestDb' // test cruft - doLast { - ant.checksum algorithm: 'md5', file: archivePath - ant.checksum algorithm: 'sha-512', fileext: '.sha', file: archivePath - println "created $destinationDir/$archiveName" - } -} - -gradle.taskGraph.whenReady { taskGraph -> - if (ext."signing.password"==null && taskGraph.allTasks.any { it instanceof Sign }) { - // Use Java console to read from the console (no good for a CI environment) - def Console console = System.console() - console.printf "\n\n#####################################" + - "\nWe have to sign some things in this build." + - "\nPlease enter your signing details.\n\n" - def id = System.env['GPG_ID'] - try { - def tmpId = console.readLine("PGP Code Signing Key Id (default: $id): ") - if (!tmpId.isEmpty()) - id = tmpId - } catch (NullPointerException e) { - throw new GradleException("You must run 'signAll --no-daemon'") - } - def file = System.env['GPG_SECRING'] - if (file == null) { - file = "${System.properties['user.home']}/.gnupg/secring.gpg" - } - def tmpFile = console.readLine("PGP Secret Key Ring File (default: $file): ") - if (!tmpFile.isEmpty()) { - file = tmpFile - } - def password = String.valueOf(console.readPassword("PGP Private Key Password: ")) - - allprojects { ext."signing.keyId" = id } - allprojects { ext."signing.secretKeyRingFile" = file } - allprojects { ext."signing.password" = password } - - console.printf "\n#####################################\n" - } -} - -task signAll(type: Sign) { - description='Sign existing release artifacts in ${target_dir}/../release-edgent (run separetely after "release")' - fileTree("${target_dir}/../release-edgent") { - include '**/*.tgz' - }.each { - sign it - } - outputs.upToDateWhen { false } - doFirst { - if (getFilesToSign().isEmpty()) { - throw new GradleException("No artifacts to sign. Run the 'release' task first.") - } - //println "### files to sign: " + getFilesToSign().collect { it.name }.join(",") - } - doLast { - println "\nCreated signature files: " + getSignatureFiles().collect { it.name }.join(", ") - } -} - -assemble { - description = "Assemble distribution artifacts and populate the target_dir with jars, doc, etc. Like 'build' w/o 'test'" - dependsOn filteredSubprojects.assemble, aggregateJavadoc, copyScripts - aggregateJavadoc.mustRunAfter filteredSubprojects*.assemble -} - -task all(dependsOn: assemble) { - description = "alias for 'assemble'" -} - -task cleanAll(type: Delete) { - description = 'clean aggregator' // "release dependsOn clean" only does top-level clean - dependsOn clean, filteredSubprojects*.clean - // purge old ant build artifacts - delete 'target' - delete 'reports' - delete fileTree(dir: '.', includes:['**/classes/', '**/test.classes/']) - // retro7 processing cruft - delete fileTree(dir: '.', includes:['**/classes.in/', '**/classes.out/']) -} - -task release { - description = 'Assemble distribution artifacts, populate target_dir, and create a release tgz' - dependsOn cleanAll, addVersionDotTxt, assemble, - ':platform:java7:addJava7TargetDir', ':platform:android:addAndroidTargetDir', - srcReleaseTarGz, releaseTarGz - addVersionDotTxt.mustRunAfter cleanAll - assemble.mustRunAfter addVersionDotTxt - releaseTarGz.mustRunAfter assemble,':platform:java7:addJava7TargetDir',':platform:android:addAndroidTargetDir' -} - -task reports { - description = "Generate JUnit and Coverage reports of prior test run. Use after 'test'" - dependsOn createJunitReport, jacocoTestReport -} - -task test7AdjustJacocoReport << { - jacocoTestReport.test7AdjustJacocoReport = true - logger.lifecycle "### NOTE: [WIP] test7 jacoco reporting ###" -} - -task test7Reports { - description = "Generate JUnit and Coverage reports of prior test run. Use after 'test7Run'" - dependsOn createJunitReport, test7AdjustJacocoReport, jacocoTestReport - jacocoTestReport.mustRunAfter test7AdjustJacocoReport -} - -// build: inject test report generation and javadoc generation (for early problem detection) -// make 'build' like "all test reports" -build { - dependsOn filteredSubprojects.build, reports - reports.mustRunAfter filteredSubprojects.build -} - -task setupExternalJars { - description = 'Add all of the dependant external jars to the target-dir (make available to Eclipse, etc)' - dependsOn setupCommonExtJars, filteredSubprojects.setupProjectExtJars -}
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/command/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/command/build.gradle b/connectors/command/build.gradle deleted file mode 100644 index a5eb48c..0000000 --- a/connectors/command/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addTargetDirProjectJarDependency 'compile', ':api:topology' - addTargetDirProjectJarDependency 'compile', ':connectors:common' - - addTargetDirProjectJarDependency 'testCompile', ':providers:direct' - // N.B. root project adds test common dependencies -} - -addCompileTestDependencies ':api:topology', ':providers:direct', ':connectors:common' http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/common/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/common/build.gradle b/connectors/common/build.gradle deleted file mode 100644 index 99f1553..0000000 --- a/connectors/common/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addTargetDirProjectJarDependency 'compile', ':api:topology' - addTargetDirCoreExtJarDependencies 'compile' - - addTargetDirProjectJarDependency 'testCompile', ':providers:direct' - // N.B. root project adds test common dependencies -} - -addCompileTestDependencies ':api:topology', ':providers:direct' - -test { - // this project lacks tests and this task fails if attempted - enabled = false -} http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/csv/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/csv/build.gradle b/connectors/csv/build.gradle deleted file mode 100644 index 6a08147..0000000 --- a/connectors/csv/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addTargetDirProjectJarDependency 'compile', ':api:topology' - addTargetDirCoreExtJarDependencies 'compile' - - addTargetDirProjectJarDependency 'testCompile', ':providers:direct' - // N.B. root project adds test common dependencies -} - -addCompileTestDependencies ':api:topology', ':providers:direct', ':connectors:common' http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/file/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/file/build.gradle b/connectors/file/build.gradle deleted file mode 100644 index 6a08147..0000000 --- a/connectors/file/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addTargetDirProjectJarDependency 'compile', ':api:topology' - addTargetDirCoreExtJarDependencies 'compile' - - addTargetDirProjectJarDependency 'testCompile', ':providers:direct' - // N.B. root project adds test common dependencies -} - -addCompileTestDependencies ':api:topology', ':providers:direct', ':connectors:common' http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/http/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/http/build.gradle b/connectors/http/build.gradle deleted file mode 100644 index caf8636..0000000 --- a/connectors/http/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addTargetDirProjectJarDependency 'compile', ':api:topology' - addProjectExtDependency 'compile', 'org.apache.httpcomponents:httpclient:4.5.1' - addProjectExtDependency 'compile', 'org.apache.httpcomponents:httpcore:4.4.4' - addTargetDirCoreExtJarDependencies 'compile' - - addTargetDirProjectJarDependency 'testCompile', ':providers:direct' - // N.B. root project adds test common dependencies -} - -addCompileTestDependencies ':api:topology', ':providers:direct' http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/iot/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/iot/build.gradle b/connectors/iot/build.gradle deleted file mode 100644 index 6a86d26..0000000 --- a/connectors/iot/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addTargetDirProjectJarDependency 'compile', ':api:topology' - addTargetDirCoreExtJarDependencies 'compile' - - addTargetDirProjectJarDependency 'testCompile', ':providers:direct' - // N.B. root project adds test common dependencies -} - -addCompileTestDependencies ':api:topology', ':providers:direct' http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/iotp/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/iotp/build.gradle b/connectors/iotp/build.gradle deleted file mode 100644 index c5e2390..0000000 --- a/connectors/iotp/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addTargetDirProjectJarDependency 'compile', ':api:topology' - addTargetDirProjectJarDependency 'compile', ':connectors:iot' - addProjectExtDependency 'compile', 'com.ibm.messaging:watson-iot:0.2.2' - addTargetDirCoreExtJarDependencies 'compile' - - addTargetDirProjectJarDependency 'testCompile', ':providers:direct' - // N.B. root project adds test common dependencies -} - -addCompileTestDependencies ':api:topology', ':providers:direct' http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/jdbc/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/jdbc/build.gradle b/connectors/jdbc/build.gradle deleted file mode 100644 index 0eef8c2..0000000 --- a/connectors/jdbc/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addTargetDirProjectJarDependency 'compile', ':api:topology' - addTargetDirCoreExtJarDependencies 'compile' - addTargetDirProjectJarDependency 'testCompile', ':providers:direct' - - testCompile files("${System.env.DERBY_HOME}/lib/derby.jar") - // N.B. root project adds test common dependencies -} - -addCompileTestDependencies ':api:topology', ':providers:direct', ':connectors:common' http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/kafka/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/kafka/build.gradle b/connectors/kafka/build.gradle deleted file mode 100644 index 047bed7..0000000 --- a/connectors/kafka/build.gradle +++ /dev/null @@ -1,48 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addTargetDirProjectJarDependency 'compile', ':api:topology' - - // The pom for kafka includes dependencies that don't make sense for us. - // In at least one case kafka dependencies include a slf4j *implementation* jar - // and that conflicts with our samples' binding to a particular - // version of slf4j implementation. - // This all seems like fallout from, I believe, the kafka jars containing - // the code for their cli tools too, and possibly tests, which need things like: - // slf4j-log4j12, snappy-java, jline, jopt-simple, junit-3.8.1 - // - // So at least for now, avoid transitive and just match our ant based config - // - // addProjectExtDependency 'compile', 'org.apache.kafka:kafka_2.10:0.8.2.2' - // addProjectExtDependency 'compile', 'org.apache.kafka:kafka-clients:0.8.2.2' - addProjectExtDependency 'compile', 'org.apache.kafka:kafka_2.10:0.8.2.2@jar' - addProjectExtDependency 'compile', 'org.apache.kafka:kafka-clients:0.8.2.2@jar' - addProjectExtDependency 'compile', 'log4j:log4j:1.2.16@jar' - addProjectExtDependency 'compile', 'com.yammer.metrics:metrics-core:2.2.0@jar' - addProjectExtDependency 'compile', 'org.scala-lang:scala-library:2.10.4@jar' - addProjectExtDependency 'compile', 'com.101tec:zkclient:0.3@jar' - addProjectExtDependency 'compile', 'org.apache.zookeeper:zookeeper:3.4.6@jar' - - addTargetDirCoreExtJarDependencies 'compile' - - addTargetDirProjectJarDependency 'testCompile', ':providers:direct' - // N.B. root project adds test common dependencies -} - -addCompileTestDependencies ':api:topology', ':providers:direct', ':connectors:common' http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/kafka/src/test/java/org/apache/edgent/test/connectors/kafka/KafkaStreamsSkipMeTest.java ---------------------------------------------------------------------- diff --git a/connectors/kafka/src/test/java/org/apache/edgent/test/connectors/kafka/KafkaStreamsSkipMeTest.java b/connectors/kafka/src/test/java/org/apache/edgent/test/connectors/kafka/KafkaStreamsSkipMeTest.java index 78bdc47..fbc9a8c 100644 --- a/connectors/kafka/src/test/java/org/apache/edgent/test/connectors/kafka/KafkaStreamsSkipMeTest.java +++ b/connectors/kafka/src/test/java/org/apache/edgent/test/connectors/kafka/KafkaStreamsSkipMeTest.java @@ -23,7 +23,7 @@ import static org.junit.Assume.assumeTrue; import org.junit.Test; /* - * Our current gradle driven test config (test filtering with + * Our current maven/gradle driven test config (test filtering with * includeTestsMatching '*Test') results in failing a project's * test task if the project lacks any "*Test" classes. * http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/mqtt/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/mqtt/build.gradle b/connectors/mqtt/build.gradle deleted file mode 100644 index 2d1d32e..0000000 --- a/connectors/mqtt/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addTargetDirProjectJarDependency 'compile', ':api:topology' - addTargetDirProjectJarDependency 'compile', ':connectors:iot' - addTargetDirProjectJarDependency 'compile', ':connectors:common' - addProjectExtDependency 'compile', 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.0' - - addTargetDirProjectJarDependency 'testCompile', ':providers:direct' - // N.B. root project adds test common dependencies -} - -addCompileTestDependencies ':api:topology', ':providers:direct', ':connectors:common' http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/pubsub/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/pubsub/build.gradle b/connectors/pubsub/build.gradle deleted file mode 100644 index 6a86d26..0000000 --- a/connectors/pubsub/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addTargetDirProjectJarDependency 'compile', ':api:topology' - addTargetDirCoreExtJarDependencies 'compile' - - addTargetDirProjectJarDependency 'testCompile', ':providers:direct' - // N.B. root project adds test common dependencies -} - -addCompileTestDependencies ':api:topology', ':providers:direct' http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/serial/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/serial/build.gradle b/connectors/serial/build.gradle deleted file mode 100644 index 6a86d26..0000000 --- a/connectors/serial/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addTargetDirProjectJarDependency 'compile', ':api:topology' - addTargetDirCoreExtJarDependencies 'compile' - - addTargetDirProjectJarDependency 'testCompile', ':providers:direct' - // N.B. root project adds test common dependencies -} - -addCompileTestDependencies ':api:topology', ':providers:direct' http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/websocket-base/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/websocket-base/build.gradle b/connectors/websocket-base/build.gradle deleted file mode 100644 index 6a86d26..0000000 --- a/connectors/websocket-base/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addTargetDirProjectJarDependency 'compile', ':api:topology' - addTargetDirCoreExtJarDependencies 'compile' - - addTargetDirProjectJarDependency 'testCompile', ':providers:direct' - // N.B. root project adds test common dependencies -} - -addCompileTestDependencies ':api:topology', ':providers:direct' http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/websocket-jetty/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/websocket-jetty/build.gradle b/connectors/websocket-jetty/build.gradle deleted file mode 100644 index 0391c10..0000000 --- a/connectors/websocket-jetty/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -archivesBaseName = project.name - -dependencies { - addTargetDirProjectJarDependency 'compile', ':connectors:edgent.javax.websocket' - addProjectExtDependency 'compile', 'org.eclipse.jetty.websocket:javax-websocket-client-impl:9.3.6.v20151106' - - // N.B. root project adds test common dependencies -} http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/websocket-misc/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/websocket-misc/build.gradle b/connectors/websocket-misc/build.gradle deleted file mode 100644 index 9a06f08..0000000 --- a/connectors/websocket-misc/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -archivesBaseName = project.name - -dependencies { - addProjectExtDependency 'compile', 'javax.websocket:javax.websocket-api:1.0' - - // N.B. root project adds test common dependencies -} http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/websocket-server/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/websocket-server/build.gradle b/connectors/websocket-server/build.gradle deleted file mode 100644 index 16d7f5f..0000000 --- a/connectors/websocket-server/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -archivesBaseName = project.name - -dependencies { - addTargetDirProjectJarDependency 'compile', ':connectors:javax.websocket-client' - addProjectExtDependency 'compile', 'org.eclipse.jetty.websocket:javax-websocket-server-impl:9.3.6.v20151106' - - // N.B. root project adds test common dependencies -} http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/connectors/websocket/build.gradle ---------------------------------------------------------------------- diff --git a/connectors/websocket/build.gradle b/connectors/websocket/build.gradle deleted file mode 100644 index e0c84dc..0000000 --- a/connectors/websocket/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addTargetDirProjectJarDependency 'compile', ':api:topology' - addTargetDirProjectJarDependency 'compile', ':connectors:common' - addTargetDirProjectJarDependency 'compile', ':connectors:wsclient' - addTargetDirProjectJarDependency 'compile', ':connectors:edgent.javax.websocket' - - addTargetDirProjectJarDependency 'testCompile', ':providers:direct' - addTargetDirProjectJarDependency 'testCompile', ':connectors:javax.websocket-client' - addTargetDirProjectJarDependency 'testCompile', ':connectors:javax.websocket-server' - - // N.B. root project adds test common dependencies -} - -addCompileTestDependencies ':api:topology', ':providers:direct', ':connectors:common' http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/console/server/build.gradle ---------------------------------------------------------------------- diff --git a/console/server/build.gradle b/console/server/build.gradle deleted file mode 100644 index 1febc14..0000000 --- a/console/server/build.gradle +++ /dev/null @@ -1,33 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -dependencies { - addProjectExtDependency 'compile', 'org.eclipse.jetty:jetty-http:9.3.6.v20151106' - addProjectExtDependency 'compile', 'org.eclipse.jetty:jetty-io:9.3.6.v20151106' - addProjectExtDependency 'compile', 'org.eclipse.jetty:jetty-security:9.3.6.v20151106' - addProjectExtDependency 'compile', 'org.eclipse.jetty:jetty-server:9.3.6.v20151106' - addProjectExtDependency 'compile', 'org.eclipse.jetty:jetty-servlet:9.3.6.v20151106' - addProjectExtDependency 'compile', 'org.eclipse.jetty:jetty-util:9.3.6.v20151106' - addProjectExtDependency 'compile', 'org.eclipse.jetty:jetty-webapp:9.3.6.v20151106' - addProjectExtDependency 'compile', 'org.eclipse.jetty:jetty-xml:9.3.6.v20151106' - addTargetDirCoreExtJarDependencies 'compile' - - // TODO runtime dependsOn ":console:servlets" ??? - - // N.B. root project adds test common dependencies -} http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/console/servlets/build.gradle ---------------------------------------------------------------------- diff --git a/console/servlets/build.gradle b/console/servlets/build.gradle deleted file mode 100644 index 272a672..0000000 --- a/console/servlets/build.gradle +++ /dev/null @@ -1,48 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ -distsDirName = 'webapps' - -plugins.apply 'war' - -dependencies { - addTargetDirProjectJarDependency 'providedCompile', ':utils:streamscope' - addProjectExtDependency 'providedCompile', 'javax.servlet:javax.servlet-api:3.1.0' - addTargetDirCoreExtJarDependencies 'providedCompile' - - // N.B. root project adds test common dependencies -} - -war { - destinationDir = file("$target_java8_dir/$project.simpleGroupName/webapps") - archiveName 'console.war' - from file('webapp_content/html') - into('resources') { - from file('webapp_content/resources') - } - into('js') { - from file('webapp_content/js') - } - webXml = file('webapp_content/WEB-INF/console.xml') - - doFirst { - configure jarOptions - } -} - -testClasses.dependsOn war http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/gradle.properties ---------------------------------------------------------------------- diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index cca1472..0000000 --- a/gradle.properties +++ /dev/null @@ -1,27 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -build_group: org.apache.edgent -build_name: edgent -build_version: 1.2.0 -build_vendor: Apache Software Foundation - -# Minimum required gradle version and version for the wrapper to use. -# Comment out gradleDistributionSha256Sum to disable validation of -# a wrapper downloaded gradle distribution. -gradleVersion = 3.1 -gradleDistributionSha256Sum = c7de3442432253525902f7e8d7eac8b5fd6ce1623f96d76916af6d0e383010fc http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/gradle/jacoco.gradle ---------------------------------------------------------------------- diff --git a/gradle/jacoco.gradle b/gradle/jacoco.gradle deleted file mode 100644 index bcdb738..0000000 --- a/gradle/jacoco.gradle +++ /dev/null @@ -1,155 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ - -task jacocoTestReport { - description = "Generates a coverage report from all subprojects (use after 'test')" - ext.test7AdjustJacocoReport = false -} -jacocoTestReport << { - - ant.delete(dir: "${target_report_dir}/coverage") - - def libDir = new File("${target_java8_dir}", "lib") - def utilsDir = new File("${target_java8_dir}", "utils") - def connectorsDir = new File("${target_java8_dir}", "connectors") - def analyticsDir = new File("${target_java8_dir}", "analytics") - def consoleDir = new File("${target_java8_dir}", "console") - - if( !libDir.exists() ) { libDir.mkdirs() } - if( !utilsDir.exists() ) { utilsDir.mkdirs() } - if( !connectorsDir.exists() ) { connectorsDir.mkdirs() } - if( !analyticsDir.exists() ) { analyticsDir.mkdirs() } - if( !consoleDir.exists() ) { consoleDir.mkdirs() } - - FileCollection executionData = files() - - subprojects.findAll { subproject -> - subproject.pluginManager.hasPlugin('java') && subproject.pluginManager.hasPlugin('jacoco') - }.each { subproject -> - executionData += subproject.tasks.jacocoTestReport.executionData - } - - executionData = files(executionData.findAll { - it.exists() - }) - ant.taskdef(name: 'jacocoReport', classname: 'org.jacoco.ant.ReportTask', - classpath: configurations.junitLibs.asPath) - ant.jacocoReport { - executiondata { - executionData.addToAntBuilder(ant, 'resources') - } - - platformTargetDir = target_java8_dir - if (test7AdjustJacocoReport) { - platformTargetDir = target_java7_dir - } - - structure(name: project.name) { - group(name: "Edgent API") { - classfiles { - fileset(dir: "$platformTargetDir/lib", includes: "edgent.api.*.jar") - } - sourcefiles { - fileset(dir: "./api/function/src/main/java", includes: "**/*.java") - fileset(dir: "./api/execution/src/main/java", includes: "**/*.java") - fileset(dir: "./api/oplet/src/main/java", includes: "**/*.java") - fileset(dir: "./api/graph/src/main/java", includes: "**/*.java") - fileset(dir: "./api/topology/src/main/java", includes: "**/*.java") - } - } - group(name: "Edgent SPI") { - classfiles { - fileset(dir: "$platformTargetDir/lib", includes: "edgent.spi.*.jar") - } - sourcefiles { - fileset(dir: "./spi/graph/src/main/java", includes: "**/*.java") - fileset(dir: "./spi/topology/src/main/java", includes: "**/*.java") - } - } - group(name: "Edgent Runtime") { - classfiles { - fileset(dir: "$platformTargetDir/lib", includes: "edgent.runtime.*.jar") - } - sourcefiles { - fileset(dir: "./runtime/etiao/src/main/java", includes: "**/*.java") - fileset(dir: "./runtime/jmxcontrol/src/main/java", includes: "**/*.java") - } - } - group(name: "Edgent Utilities") { - classfiles { - fileset(dir: "$platformTargetDir/utils", includes: "**/edgent.utils.*.jar") - } - sourcefiles { - fileset(dir: "./utils/metrics/src/main/java", includes: "**/*.java") - fileset(dir: "./utils/streamscope/src/main/java", includes: "**/*.java") - } - } - group(name: "Edgent Connectors") { - classfiles { - fileset(dir: "$platformTargetDir/connectors", includes: "**/edgent.connectors.*.jar") - } - sourcefiles { - fileset(dir: "./connectors/common/src/main/java", includes: "**/*.java") - fileset(dir: "./connectors/command/src/main/java", includes: "**/*.java") - fileset(dir: "./connectors/csv/src/main/java", includes: "**/*.java") - fileset(dir: "./connectors/file/src/main/java", includes: "**/*.java") - fileset(dir: "./connectors/iot/src/main/java", includes: "**/*.java") - fileset(dir: "./connectors/iotp/src/main/java", includes: "**/*.java") - fileset(dir: "./connectors/jdbc/src/main/java", includes: "**/*.java") - fileset(dir: "./connectors/kafka/src/main/java", includes: "**/*.java") - fileset(dir: "./connectors/mqtt/src/main/java", includes: "**/*.java") - fileset(dir: "./connectors/http/src/main/java", includes: "**/*.java") - fileset(dir: "./connectors/wsclient/src/main/java", includes: "**/*.java") - fileset(dir: "./connectors/wsclient-javax.websocket/src/main/java", includes: "**/*.java") - } - } - group(name: "Edgent Providers") { - classfiles { - fileset(dir: "$platformTargetDir/lib", includes: "edgent.providers.*.jar") - } - sourcefiles { - fileset(dir: "./providers/direct/src/main/java", includes: "**/*.java") - fileset(dir: "./providers/development/src/main/java", includes: "**/*.java") - } - } - if (!test7AdjustJacocoReport) { - group(name: "Edgent Analytics") { - classfiles { - fileset(dir: "$platformTargetDir/analytics", includes: "**/edgent.analytics.*.jar") - } - sourcefiles { - fileset(dir: "./analytics/math3/src/main/java", includes: "**/*.java") - fileset(dir: "./analytics/sensors/src/main/java", includes: "**/*.java") - } - } - group(name: "Edgent Console") { - classfiles { - fileset(dir: "$platformTargetDir/console", includes: "**/edgent.console.*.jar") - } - sourcefiles { - fileset(dir: "./console/server/src/main/java", includes: "**/*.java") - fileset(dir: "./console/servlets/src/main/java", includes: "**/*.java") - } - } - } - } - html(destdir: "${target_report_dir}/coverage/") - xml(destfile: "${target_report_dir}/coverage/jacoco-sessions.xml") - } -} http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/gradle/javadoc.gradle ---------------------------------------------------------------------- diff --git a/gradle/javadoc.gradle b/gradle/javadoc.gradle deleted file mode 100644 index 85bfff3..0000000 --- a/gradle/javadoc.gradle +++ /dev/null @@ -1,59 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ - -task aggregateJavadoc(type: Javadoc) { - description = 'Create all javadoc into target_dir/docs/javadoc' - destinationDir file(target_javadoc_dir) - options.addStringOption('Xdoclint:none', '-quiet') - configure(options) { - author = true - version = true - use = true - docTitle "Apache Edgent (incubating) v${build_version}" - footer '<a href="http://edgent.incubator.apache.org">Apache Edgent (incubating)</a>' - bottom "Copyright © ${COPYRIGHT_YEAR} The Apache Software Foundation. All Rights Reserved - ${commithash}-${DSTAMP}-${TSTAMP}" - overview "edgent_overview.html" - windowTitle "Edgent v${build_version}" - - group("Edgent Providers", "org.apache.edgent.providers.*") - group("Edgent API", "org.apache.edgent.execution", "org.apache.edgent.function", "org.apache.edgent.topology", "org.apache.edgent.topology.json", "org.apache.edgent.topology.mbeans", "org.apache.edgent.topology.plumbing", "org.apache.edgent.topology.services", "org.apache.edgent.execution.*") - group("Edgent Analytics", "org.apache.edgent.analytics.*") - group("Edgent Utilities", "org.apache.edgent.metrics", "org.apache.edgent.metrics.*", "org.apache.edgent.streamscope", "org.apache.edgent.streamscope.*") - group("Edgent Connectors", "org.apache.edgent.connectors.*") - group("Edgent Samples", "org.apache.edgent.samples.*") - group("Edgent Low-Level API", "org.apache.edgent.graph", "org.apache.edgent.graph.*", "org.apache.edgent.oplet", "org.apache.edgent.oplet.*", "org.apache.edgent.window") - group("Edgent SPI", "org.apache.edgent.topology.spi", "org.apache.edgent.topology.spi.*") - } - source subprojects.collect { project -> project.sourceSets.main.allJava } - exclude "**/edgent/connectors/**/runtime" - exclude "**/edgent/console" - exclude "**/edgent/samples/scenarios/iotp/range/sensor" - exclude "**/android/**" - classpath = files(filteredSubprojects.collect { it.jar.archivePath }) - - // doc-files aren't picked up automatically so get them now. - doLast { - copy { - from subprojects.collect { project -> project.sourceSets.main.java.srcDirs } - include '**/doc-files/**' - includeEmptyDirs = false - into target_javadoc_dir - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/gradle/other.gradle ---------------------------------------------------------------------- diff --git a/gradle/other.gradle b/gradle/other.gradle deleted file mode 100644 index 944bacf..0000000 --- a/gradle/other.gradle +++ /dev/null @@ -1,65 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ - -ext.unsupportedJava7TestProjects = [ // why not on all of these? (match ant_test7.run, see JAVA_SUPPORT.md) - // projects with no tests will be automatically avoided for java7 tests - // otherwise those that are not yet supported for java7 (not in ant_test7.{setup,run}) must be added here - ':api:graph', // no runnable tests - ':analytics:math3', - ':analytics:sensors', - ':connectors:command', - ':connectors:csv', - ':connectors:file', - ':connectors:jdbc', - ':connectors:mqtt', - ':connectors:kafka', - ':connectors:serial', - ':connectors:wsclient', - ':connectors:wsclient-javax.websocket', - ':connectors:javax.websocket-client', - ':connectors:edgent.javax.websocket', - ':connectors:javax.websocket-server', - ':console:server', - ':console:servlets', - ':providers:development', - ':utils:streamscope', - ':test:fvtiot', - ':test:svt', -] - -ext.projectsWithPreApacheContribs = [ - ':analytics:math3', ':analytics:sensors', - ':android:topology', ':android:hardware', - ':api:function', ':api:execution', ':api:window', ':api:oplet', - ':api:graph', ':api:topology', - ':connectors:common', ':connectors:iot', ':connectors:serial', - ':connectors:file', ':connectors:http', ':connectors:iotp', - ':connectors:jdbc', ':connectors:kafka', ':connectors:mqtt', - ':connectors:edgent.javax.websocket', - ':connectors:javax.websocket-client', ':connectors:javax.websocket-server', - ':connectors:wsclient', ':connectors:wsclient-javax.websocket', - ':console:server', ':console:servlets', - ':providers:direct', ':providers:development', - ':runtime:etiao', ':runtime:jmxcontrol', ':runtime:jsoncontrol', - ':samples:utils', ':samples:apps', ':samples:topology', ':samples:connectors', - ':samples:console', - ':spi:graph', ':spi:topology', - ':test:svt', - ':utils:metrics', -] http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/52f6fb33/gradle/rat.gradle ---------------------------------------------------------------------- diff --git a/gradle/rat.gradle b/gradle/rat.gradle deleted file mode 100644 index 2de8999..0000000 --- a/gradle/rat.gradle +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// shamelessly copied from https://github.com/apache/samza - -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.api.Task -import org.gradle.api.internal.project.IsolatedAntBuilder - -apply plugin: RatPlugin - -class RatTask extends DefaultTask { - @Input - List<String> excludes - - def reportPath = 'build/rat' - def stylesheet = 'gradle/resources/rat-output-to-html.xsl' - def xmlReport = reportPath + '/rat-report.xml' - def htmlReport = reportPath + '/rat-report.html' - def textReport = reportPath + '/rat-report.txt' - - def generateTextReport(File reportDir) { - def antBuilder = services.get(IsolatedAntBuilder) - def ratClasspath = project.configurations.rat - antBuilder.withClasspath(ratClasspath).execute { - ant.taskdef(resource: 'org/apache/rat/anttasks/antlib.xml') - ant.report(format: 'plain', reportFile: textReport) { - fileset(dir: ".") { - patternset { - excludes.each { - exclude(name: it) - } - } - } - } - } - } - - def generateXmlReport(File reportDir) { - def antBuilder = services.get(IsolatedAntBuilder) - def ratClasspath = project.configurations.rat - antBuilder.withClasspath(ratClasspath).execute { - ant.taskdef(resource: 'org/apache/rat/anttasks/antlib.xml') - ant.report(format: 'xml', reportFile: xmlReport) { - fileset(dir: ".") { - patternset { - excludes.each { - exclude(name: it) - } - } - } - } - } - } - - def printUnknownFiles() { - def ratXml = new XmlParser().parse(xmlReport) - def unknownLicenses = 0 - ratXml.resource.each { resource -> - if (resource.'license-approval'.@name[0] == "false") { - println('Unknown license: ' + resource.@name) - unknownLicenses++ - } - } - if (unknownLicenses > 0) { - throw new GradleException("Found " + unknownLicenses + " files with " + - "unknown licenses.") - } - } - - def generateHtmlReport() { - def antBuilder = services.get(IsolatedAntBuilder) - def ratClasspath = project.configurations.rat - antBuilder.withClasspath(ratClasspath).execute { - ant.xslt( - in: xmlReport, - style: stylesheet, - out: htmlReport, - classpath: ratClasspath) - } - println('Rat report: ' + htmlReport) - } - - @TaskAction - def rat() { - File reportDir = new File(reportPath) - if (!reportDir.exists()) { - reportDir.mkdirs() - } - generateXmlReport(reportDir) - generateHtmlReport() - generateTextReport() - printUnknownFiles() - } -} - -class RatPlugin implements Plugin<Project> { - void apply(Project project) { - configureDependencies(project) - project.plugins.apply(JavaBasePlugin); - Task ratTask = project.task("rat", - type: RatTask, - group: 'Build', - description: 'Runs Apache Rat checks.') - project.tasks[JavaBasePlugin.CHECK_TASK_NAME].dependsOn ratTask - } - - void configureDependencies(final Project project) { - project.configurations { - rat - } - project.repositories { - mavenCentral() - } - project.dependencies { - rat 'org.apache.rat:apache-rat-tasks:0.12' - } - } -} \ No newline at end of file