選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

build.gradle 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /* ====================================================================
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. sourceSets {
  16. main {
  17. if (jdkVersion > 8) {
  18. output.dir(JAVA9_OUT, builtBy: 'cacheJava9')
  19. }
  20. }
  21. }
  22. dependencies {
  23. api 'net.bytebuddy:byte-buddy:1.12.+'
  24. api 'net.bytebuddy:byte-buddy-agent:1.12.+'
  25. //api "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}"
  26. api files("/Users/pj.fanning/Downloads/xmlbeans-5.1.0.jar")
  27. }
  28. final MODULE_NAME = 'org.apache.poi.ooxml_lite'
  29. java {
  30. toolchain {
  31. languageVersion.set(JavaLanguageVersion.of(jdkVersion))
  32. if (jdkVendor != '') vendor.set(JvmVendorSpec.matching(jdkVendor))
  33. }
  34. }
  35. task compileJava9(type: JavaCompile) {
  36. dependsOn 'compileJava'
  37. javaCompiler = javaToolchains.compilerFor {
  38. languageVersion = JavaLanguageVersion.of(jdkVersion)
  39. if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor)
  40. }
  41. destinationDirectory = file(JAVA9_OUT + VERSIONS9)
  42. source = file(JAVA9_SRC)
  43. classpath = files()
  44. doFirst {
  45. options.compilerArgs = [
  46. '--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}",
  47. '--module-path', sourceSets.main.compileClasspath.asPath
  48. ]
  49. }
  50. onlyIf {
  51. jdkVersion > 8
  52. }
  53. }
  54. task cacheJava9(type: Copy) {
  55. dependsOn 'compileJava9'
  56. from(file(JAVA9_OUT + VERSIONS9))
  57. into(JAVA9_SRC)
  58. }
  59. jar {
  60. destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
  61. if (jdkVersion == 8) {
  62. into('META-INF/versions/9') {
  63. from JAVA9_SRC include '*.class'
  64. }
  65. }
  66. manifest {
  67. attributes (
  68. 'Automatic-Module-Name' : MODULE_NAME,
  69. 'Multi-Release': 'true',
  70. 'Premain-Class' : 'org.apache.poi.ooxml.lite.OOXMLLiteAgent'
  71. )
  72. }
  73. }
  74. spotbugsMain.enabled = false
  75. javadoc.enabled = false
  76. javadocJar.enabled = false