Skip to content

Instantly share code, notes, and snippets.

/**
* Transfer AD date to minguo date.
* 西元年 yyyyMMdd 轉 民國年 yyyMMdd
*
* @param dateString the String dateString
* @return the string
*/
public static String transferADDateToMinguoDate(String dateString) {
LocalDate localDate = LocalDate.parse(dateString, DateTimeFormatter.ofPattern("yyyyMMdd"));
return MinguoDate.from(localDate).format(DateTimeFormatter.ofPattern("yyyMMdd"));
/** 匯出所有用到的jar,包括依賴的jar
使用前將 build.gradle 的 dependencies 中 implementation 改成 compile
*/
task copyJars(type:Copy) {
from configurations.runtime
into 'lib' // 目標位置
}
@erics
erics / executeGitInGradle.txt
Last active June 2, 2023 20:40
execute git command in gradle
def getGitCommand = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'log','--date=local','--name-status','--after="2018.07.19"'
standardOutput = stdout
}
return stdout.toString().trim()
}
task prinGitLog{