This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MatlabTimeHelper { | |
public static final int UNIX_EPOCH_START_MATLAB_DAYS = 719529; | |
public static long matlabToMillis(double matlab) { | |
return (long) (matlab - UNIX_EPOCH_START_MATLAB_DAYS) * 24 * 3600 * 1000; | |
} | |
public static double millisToMatlab(long millis) { | |
return millis / (24.0 * 3600 * 1000) + UNIX_EPOCH_START_MATLAB_DAYS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Task to get current version of the project. | |
task version(type: VersionTask) | |
class VersionTask extends DefaultTask { | |
@TaskAction | |
def version() { | |
println project.version | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'java' | |
apply plugin: 'maven-publish' | |
task sourceJar(type: Jar) { | |
// Specifies a JAR that contains source code from the library. | |
from sourceSets.main.allJava | |
} | |
task fatJar(type: Jar, dependsOn: build) { | |
// Creates a JAR that contains all dependencies in addition to the library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task javadocJar(type: Jar, dependsOn: javadoc) { | |
from javadoc.destinationDir | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task sourceJar(type: Jar) { | |
from sourceSets.main.allJava | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jar { | |
// from http://fw-geekycoder.blogspot.com/2011/11/how-to-create-jar-with-dependencies-in.html | |
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } | |
manifest { attributes 'Main-Class': 'test.Main' } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rootProject.name = "artifact-name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repositories { | |
mavenCentral() | |
maven { | |
// via https://support.sonatype.com/entries/21596297.html | |
url "http://www.sonatypenexus.com/maven/" | |
credentials { | |
username mavenUser | |
password mavenPass | |
} | |
} |
NewerOlder