comparison init50-git.gradle @ 343:54614542f0f7

add println for debugging
author Marc Davis <marc.davis@mcoecn.org>
date Wed, 14 Jun 2023 14:32:05 -0400
parents 64a8d53c6d98
children 0bef709263cd
comparison
equal deleted inserted replaced
342:9791f84cfc67 343:54614542f0f7
804 return v 804 return v
805 } catch (ignored) { 805 } catch (ignored) {
806 //non semver tag found, ignoring 806 //non semver tag found, ignoring
807 } 807 }
808 } 808 }
809 .findAll { it != null }
809 .sort { v1, v2 -> v2 <=> v1 } 810 .sort { v1, v2 -> v2 <=> v1 }
810 811
811 def branches = "git branch --remote".execute().text.split("\n") 812 def branches = "git branch --remote".execute().text.split("\n")
812 .findAll { it.contains('release') || it.contains('hotfix') } 813 .findAll { it.contains('release') || it.contains('hotfix') }
813 .collect { it.replaceAll('\\s+', ' ').split('/').last() - 'v' } 814 .collect { it.replaceAll('\\s+', ' ').split('/').last() - 'v' }
814 .collect { new Version(*it.split('\\.')*.toInteger()) } 815 .collect { new Version(*it.split('\\.')*.toInteger()) }
815 816
816 def results = (branches + versions).sort { v1, v2 -> v2 <=> v1 } 817 def results = (branches + versions).sort { v1, v2 -> v2 <=> v1 }
818 results.each { println it }
819 println "Selected version : ${results.first().nextSnapshot()}"
817 if (results.isEmpty()) { 820 if (results.isEmpty()) {
818 return new Version().nextSnapshot() 821 return new Version().nextSnapshot()
819 } else { 822 } else {
820 return results.first().nextSnapshot() 823 return results.first().nextSnapshot()
821 } 824 }