Skip to content

Commit

Permalink
update dependences version
Browse files Browse the repository at this point in the history
  • Loading branch information
potoo0 committed Jun 1, 2022
1 parent a03ad77 commit 4ad24ad
Show file tree
Hide file tree
Showing 33 changed files with 398 additions and 743 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Spencer Park
Copyright (c) ${year} ${author}

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
177 changes: 60 additions & 117 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,153 +1,96 @@
plugins {
id 'java'
id 'maven-publish'
id('com.github.hierynomus.license') version '0.14.0'
id('io.github.spencerpark.jupyter-kernel-installer') version '2.1.0'
id('com.github.jk1.dependency-license-report')
}

import com.github.jk1.license.filter.LicenseBundleNormalizer
import com.github.jk1.license.render.InventoryHtmlReportRenderer
import com.github.jk1.license.render.JsonReportRenderer
import org.apache.tools.ant.filters.ReplaceTokens
import com.github.jk1.license.render.*
import com.github.jk1.license.filter.*
import io.github.spencerpark.gradle.*

group = 'io.github.spencerpark'
version = '1.3.0'

wrapper {
gradleVersion = '4.8.1'
distributionType = Wrapper.DistributionType.ALL
}

// Add the license header to source files
license {
header = file('LICENSE')
exclude '**/*.json'
mapping {
// Use a regular multiline comment rather than a javadoc comment
java = 'SLASHSTAR_STYLE'
}
}
build.dependsOn 'licenseFormat'

// Configures the license report generated for the dependencies.
licenseReport {
excludeGroups = []
renderers = [
// Generate a pretty HTML report that groups dependencies by their license.
new NewInventoryHtmlReportRenderer('dependencies.html'),
// 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()]

configurations = ['compile']
}

compileJava {
sourceCompatibility = 1.9
targetCompatibility = 1.9
plugins {
id 'java'
// id 'maven-publish' // use johnrengelman.shadow instead
id 'com.github.hierynomus.license' version '0.16.1'
id "com.github.jk1.dependency-license-report" version "2.1"
id 'com.github.johnrengelman.shadow' version '7.1.2'
// id 'io.github.spencerpark.jupyter-kernel-installer' version '2.1.0'
}

configurations {
shade
// transitive true to make sure that the dependencies of shade dependencies also get shaded
// into the jar
shade.transitive = true
compile.extendsFrom(shade)
}
group = 'io.github.spencerpark'
version = '1.3.1'

repositories {
mavenLocal()
mavenCentral()
maven {
url = 'https://oss.sonatype.org/content/repositories/snapshots/'
}
mavenLocal()
}

dependencies {
shade group: 'io.github.spencerpark', name: 'jupyter-jvm-basekernel', version: '2.3.0'

shade group: 'org.apache.ivy', name: 'ivy', version: '2.5.0-rc1'
//shade group: 'org.apache.maven', name: 'maven-settings-builder', version: '3.6.0'
shade group: 'org.apache.maven', name: 'maven-model-builder', version: '3.6.0'
implementation group: 'io.github.spencerpark', name: 'jupyter-jvm-basekernel', version: '2.3.0'
implementation group: 'org.apache.ivy', name: 'ivy', version: '2.5.0'
implementation group: 'org.apache.maven', name: 'maven-model-builder', version: '3.8.5'

testCompile group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
}

jar {
//Include all shaded dependencies in the jar
from configurations.shade
.collect { it.isDirectory() ? it : zipTree(it) }

manifest {
attributes('Main-class': 'io.github.spencerpark.ijava.IJava')
}
// Add the license header to source files
license {
header = file('LICENSE')
include "**/*.java"
exclude "**/Test*.java"
mapping java: 'SLASHSTAR_STYLE'
ext.year = Calendar.getInstance().get(Calendar.YEAR)
}
licenseMain.dependsOn 'licenseFormat'

// replace @symbol@ in properties
processResources {
def tokens = [
'version': project.version,
'project': project.name
]
inputs.properties(tokens)
filter ReplaceTokens, tokens: tokens
filter tokens: tokens, ReplaceTokens
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
jar {
manifest {
attributes 'Main-class': 'io.github.spencerpark.ijava.IJava'
}
}

jupyter {
kernelName = 'java'
kernelDisplayName = 'Java'
kernelLanguage = 'java'
kernelInterruptMode = 'message'
// shadow Jar config
shadowJar {
// inherit from the manifest of the standard jar task
// manifest {
// attributes 'Main-class': 'io.github.spencerpark.ijava.IJava'
// }

kernelParameters {
list('classpath', 'IJAVA_CLASSPATH') {
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') {
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') {
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') {
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'
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"`).'''
}
// copy build.gradle to shadowed jar
from("./") {
include 'build.gradle'
}
}

installKernel {
kernelInstallPath = commandLineSpecifiedPath(userInstallPath)
}

zipKernel {
installers {
with 'python'
}
// publish
//publishing {
// publications {
// shadow(MavenPublication) { publication ->
// project.shadow.component(publication)
// }
// }
// repositories {
// maven {
// url "http://repo.myorg.com"
// }
// }
//}

// create license report
licenseReport {
renderers = [
new InventoryHtmlReportRenderer('license-report.html'),
new JsonReportRenderer('license-report.json')
]

from(generateLicenseReport.outputFolder) {
into 'dependency-licenses'
}
filters = [new LicenseBundleNormalizer()]
}
zipKernel.dependsOn 'generateLicenseReport'
13 changes: 0 additions & 13 deletions buildSrc/build.gradle

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4ad24ad

Please sign in to comment.