ZenScript main repository
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

common.gradle 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // This file is to be applied to every subproject.
  3. //
  4. apply plugin: 'java'
  5. apply plugin: 'maven'
  6. String mavenGroupId = 'org.openzen.zenscript'
  7. String mavenVersion = '1.0-SNAPSHOT'
  8. sourceCompatibility = '1.8'
  9. [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
  10. repositories {
  11. mavenCentral();
  12. // You may define additional repositories, or even remove "mavenCentral()".
  13. // Read more about repositories here:
  14. // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories
  15. }
  16. dependencies {
  17. // Adding dependencies here will add the dependencies to each subproject.
  18. testCompile group: 'junit', name: 'junit', version: '4.10'
  19. compile 'net.sf.trove4j:trove4j:3.0.3'
  20. }
  21. String mavenArtifactId = name
  22. group = mavenGroupId
  23. version = mavenVersion
  24. task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') {
  25. classifier = 'sources'
  26. from sourceSets.main.allSource
  27. }
  28. artifacts {
  29. archives jar
  30. archives sourcesJar
  31. }
  32. configure(install.repositories.mavenInstaller) {
  33. pom.project {
  34. groupId = mavenGroupId
  35. artifactId = mavenArtifactId
  36. version = mavenVersion
  37. }
  38. }
  39. task createFolders(description: 'Creates the source folders if they do not exist.') doLast {
  40. sourceSets*.allSource*.srcDirs*.each { File srcDir ->
  41. if (!srcDir.isDirectory()) {
  42. println "Creating source folder: ${srcDir}"
  43. srcDir.mkdirs()
  44. }
  45. }
  46. }