Advertisement
Guest User

build.gradle

a guest
Apr 26th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 1.06 KB | None | 0 0
  1. plugins {
  2.     id 'java'
  3.     id 'idea'
  4. }
  5.  
  6. repositories {
  7.     flatDir {
  8.         dirs 'lib'
  9.     }
  10. }
  11.  
  12. group = pluginGroup
  13. version = pluginVersion
  14. jar.extension = artifactExtension
  15.  
  16. sourceCompatibility = 1.8
  17. targetCompatibility = 1.8
  18.  
  19. repositories {
  20.     mavenCentral()
  21. }
  22.  
  23. dependencies {
  24.     def files = fileTree 'lib'
  25.     files.include '**/*.jar'
  26.     files.exclude '**/*-sources.jar'
  27.     files.exclude '**/*-source.jar'
  28.  
  29.     for (file in files) {
  30.         def fileName = file.name
  31.         def dependencyName = fileName.substring(0, fileName.lastIndexOf('.'))
  32.  
  33.         def directory = file.parentFile
  34.         if (directory.directory) {
  35.             def ignoreDependency = false
  36.  
  37.             for (stopSuffix in ['dev', 'deobf']) {
  38.                 if (new File(directory, dependencyName + '-' + stopSuffix + '.jar').file) {
  39.                     ignoreDependency = true
  40.                     break
  41.                 }
  42.             }
  43.  
  44.             if (ignoreDependency)
  45.                 continue
  46.         }
  47.  
  48.         compile name: dependencyName
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement