Mercurial > public > gradleplugins
comparison src/main/groovy/org/ssdt_ohio/gradle/plugins/VersionClassPlugin.groovy @ 30:bf31e9ad44cf
SC-181 Upgrade to gradle 5.0 for version 0.4.5, fix problems with VersionClassPlugin
author | Greg Shepherd <shepherd@ssdt-ohio.org> |
---|---|
date | Tue, 18 Feb 2020 16:36:38 -0500 |
parents | 278d28eea819 |
children |
comparison
equal
deleted
inserted
replaced
29:e531fc141b17 | 30:bf31e9ad44cf |
---|---|
1 /* | |
2 * Copyright (c) 2020. Ohio Department of Education. - All Rights Reserved. | |
3 * Unauthorized copying of this file, in any medium, is strictly prohibited. | |
4 * Written by the State Software Development Team (http://ssdt.oecn.k12.oh.us/) | |
5 * | |
6 */ | |
7 | |
1 package org.ssdt_ohio.gradle.plugins | 8 package org.ssdt_ohio.gradle.plugins |
2 | 9 |
3 import org.gradle.api.Plugin | 10 import org.gradle.api.Plugin |
4 import org.gradle.api.Project | 11 import org.gradle.api.Project |
5 import org.gradle.api.plugins.ExtraPropertiesExtension.UnknownPropertyException | 12 import org.gradle.api.plugins.ExtraPropertiesExtension.UnknownPropertyException |
75 } | 82 } |
76 } | 83 } |
77 | 84 |
78 makeVersionClassTask.getInputs().files(project.sourceSets.main.getAllSource().findAll{ !it.name.startsWith('ProjectVersion')} | 85 makeVersionClassTask.getInputs().files(project.sourceSets.main.getAllSource().findAll{ !it.name.startsWith('ProjectVersion')} |
79 ) | 86 ) |
80 makeVersionClassTask.getOutputs().file( project.buildDir.name + '/' + genSrc) | 87 |
88 makeVersionClassTask.getOutputs().dir(project.buildDir.name + '/' + genSrc) | |
81 | 89 |
82 if (project.getBuildFile() != null && project.getBuildFile().exists()) { | 90 if (project.getBuildFile() != null && project.getBuildFile().exists()) { |
83 makeVersionClassTask.getInputs().files(project.getBuildFile()) | 91 makeVersionClassTask.getInputs().files(project.getBuildFile()) |
84 } | 92 } |
85 | 93 |
95 return project.extensions.extraProperties.get('versionPackage') | 103 return project.extensions.extraProperties.get('versionPackage') |
96 } catch (UnknownPropertyException ex) {} | 104 } catch (UnknownPropertyException ex) {} |
97 | 105 |
98 def source = project.sourceSets.main.groovy.getSrcDirTrees() | 106 def source = project.sourceSets.main.groovy.getSrcDirTrees() |
99 | 107 |
100 def files = project.sourceSets.main.groovy as File[] | 108 def files = project.sourceSets.main.groovy |
101 if (!files ) { | 109 |
110 if (!files || files.size() == 0) { | |
102 return null | 111 return null |
103 } | 112 } |
104 | 113 |
105 def targetDir = files.sort { | 114 def targetDir = files.sort { |
106 it.parentFile.toString().replaceAll('(\\\\|/)','.').split(/\./).size() | 115 it.parentFile.toString().replaceAll('(\\\\|/)','.').split(/\./).size() |