Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

build.gradle 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. output.dir(JAVA9_OUT, builtBy: 'compileJava9')
  18. }
  19. }
  20. dependencies {
  21. api 'net.bytebuddy:byte-buddy:1.12.20'
  22. api 'net.bytebuddy:byte-buddy-agent:1.12.20'
  23. api "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}"
  24. }
  25. final MODULE_NAME = 'org.apache.poi.ooxml_lite'
  26. java {
  27. toolchain {
  28. languageVersion.set(JavaLanguageVersion.of(jdkVersion))
  29. if (jdkVendor != '') vendor.set(JvmVendorSpec.matching(jdkVendor))
  30. }
  31. }
  32. task compileJava9(type: JavaCompile) {
  33. dependsOn 'compileJava'
  34. javaCompiler = javaToolchains.compilerFor {
  35. languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
  36. }
  37. sourceCompatibility = 1.9
  38. targetCompatibility = 1.9
  39. destinationDirectory = file(JAVA9_OUT + VERSIONS9)
  40. source = file(JAVA9_SRC)
  41. classpath = files()
  42. doFirst {
  43. options.compilerArgs = [
  44. '--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}",
  45. '--module-path', sourceSets.main.compileClasspath.asPath
  46. ]
  47. }
  48. }
  49. jar {
  50. destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
  51. manifest {
  52. attributes (
  53. 'Automatic-Module-Name' : MODULE_NAME,
  54. 'Multi-Release': 'true',
  55. 'Premain-Class' : 'org.apache.poi.ooxml.lite.OOXMLLiteAgent'
  56. )
  57. }
  58. }
  59. spotbugsMain.enabled = false
  60. javadoc.enabled = false
  61. javadocJar.enabled = false