build.gradle 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. group 'cn.com.agree'
  2. version '1.0-SNAPSHOT'
  3. apply plugin: 'java'
  4. compileJava.options.encoding = 'UTF-8'
  5. sourceCompatibility = 1.8
  6. repositories {
  7. maven {
  8. url 'https://repo.maven.apache.org/maven2/'
  9. }
  10. }
  11. task fatJar(type: Jar) {
  12. manifest{
  13. attributes "Manifest-Version": "1.0",
  14. "Main-Class": "cn.com.agree.MainWindow"
  15. }
  16. var baseName = project.name + '-all'
  17. from {
  18. configurations.runtimeClasspath.collect {
  19. it.isDirectory() ? it : zipTree(it).matching { exclude { it.path.contains('META-INF') } }
  20. }
  21. }
  22. with jar
  23. }
  24. def isWindows() {
  25. return System.properties['os.name'].contains('Windows');
  26. }
  27. dependencies {
  28. if(isWindows()){
  29. implementation (fileTree('os/windows'){include '*.jar'})
  30. }else{
  31. implementation (fileTree('os/linux'){include '*.jar'})
  32. }
  33. implementation (fileTree('libs'){include '*.jar'})
  34. implementation 'org.apache.poi:poi:3.15'
  35. implementation 'org.apache.poi:poi-ooxml:3.15'
  36. implementation 'org.simplejavamail:simple-java-mail:4.1.2'
  37. implementation 'com.alibaba:fastjson:1.1.50.android'
  38. }