Skip to content
Permalink
Browse files

Include dependency report in the zip as well as the new kernel config…

…uration parameters
  • Loading branch information...
SpencerPark committed Jul 29, 2018
1 parent f8a6454 commit 3ca051131f27ea499fb68d9c28d968a1007ef08a
@@ -2,7 +2,7 @@ plugins {
id 'java'
id 'maven-publish'
id('com.github.hierynomus.license') version '0.14.0'
id('io.github.spencerpark.jupyter-kernel-installer') version '1.1.5'
id('io.github.spencerpark.jupyter-kernel-installer') version '1.1.8'
id('com.github.jk1.dependency-license-report')
}

@@ -35,18 +35,14 @@ licenseReport {
renderers = [
// Generate a pretty HTML report that groups dependencies by their license.
new NewInventoryHtmlReportRenderer('dependencies.html'),
new InventoryHtmlReportRenderer('deps.html'),
new TextReportRenderer('dependencies.txt'),
// TODO make sure ci verifies that all licenses are know to be allowed to redistribute before publishing
new JsonReportRenderer('dependencies.json')
]

// Group same licenses despite names being slightly different (ex. Apache 2.0 vs Apache version 2)
filters = [new LicenseBundleNormalizer()]

// Include the report for shaded dependencies as these are what will be redistributed
// and therefore must go in the report which will also be distributed.
configurations = ['shade']
configurations = ['compile']
}

compileJava {
@@ -80,7 +76,7 @@ dependencies {
jar {
//Include all shaded dependencies in the jar
from configurations.shade
.collect {it.isDirectory() ? it : zipTree(it)}
.collect { it.isDirectory() ? it : zipTree(it) }

manifest {
attributes('Main-class': 'io.github.spencerpark.ijava.IJava')
@@ -109,4 +105,46 @@ jupyter {
kernelDisplayName = 'Java'
kernelLanguage = 'java'
kernelInterruptMode = 'message'
}

kernelParameters {
list('classpath', 'IJAVA_CLASSPATH') {
defaultValue = ''
separator = PATH_SEPARATOR
description = '''A file path separator delimited list of classpath entries that should be available to the user code. **Important:** no matter what OS, this should use forward slash "/" as the file separator. Also each path may actually be a simple glob.'''
}

list('comp-opts', 'IJAVA_COMPILER_OPTS') {
defaultValue = ''
separator = ' '
description = '''A space delimited list of command line options that would be passed to the `javac` command when compiling a project. For example `-parameters` to enable retaining parameter names for reflection.'''
}

list('startup-scripts-path', 'IJAVA_STARTUP_SCRIPTS_PATH') {
defaultValue = ''
separator = PATH_SEPARATOR
description = '''A file path seperator delimited list of `.jshell` scripts to run on startup. This includes ijava-jshell-init.jshell and ijava-display-init.jshell. **Important:** no matter what OS, this should use forward slash "/" as the file separator. Also each path may actually be a simple glob.'''
}

string('startup-script', 'IJAVA_STARTUP_SCRIPT') {
defaultValue = ''
description = '''A block of java code to run when the kernel starts up. This may be something like `import my.utils;` to setup some default imports or even `void sleep(long time) { try {Thread.sleep(time); } catch (InterruptedException e) { throw new RuntimeException(e); }}` to declare a default utility method to use in the notebook.'''
}

string('timeout', 'IJAVA_TIMEOUT') {
aliases NO_TIMEOUT: '-1'
defaultValue = '-1'
description = '''A duration specifying a timeout (in milliseconds by default) for a _single top level statement_. If less than `1` then there is no timeout. If desired a time may be specified with a `TimeUnit` may be given following the duration number (ex `"30 SECONDS"`).'''
}
}
}

zipKernel {
installers {
with 'python'
}

from(generateLicenseReport.outputFolder) {
into 'dependency-licenses'
}
}
zipKernel.dependsOn 'generateLicenseReport'
@@ -35,12 +35,6 @@ class NewInventoryHtmlReportRenderer implements ReportRenderer {

@Override
void render(ProjectData data) {
println(
data.project.configurations['shade']
.resolvedConfiguration
.resolvedArtifacts
.findAll {it.id.displayName.contains("github")}
)
this.counter = 0

def project = data.project

0 comments on commit 3ca0511

Please sign in to comment.
You can’t perform that action at this time.