Mercurial > public > develkit
comparison init70-git.gradle @ 334:64a8d53c6d98
change how the version is parsed from git commands
author | Marc Davis <davis@ssdt-ohio.org> |
---|---|
date | Mon, 06 Mar 2023 15:36:07 -0500 |
parents | 7bc7c6c79d7c |
children | de8c350c511a |
comparison
equal
deleted
inserted
replaced
333:10e2b8595ace | 334:64a8d53c6d98 |
---|---|
803 } | 803 } |
804 .sort { v1, v2 -> v2 <=> v1 } | 804 .sort { v1, v2 -> v2 <=> v1 } |
805 | 805 |
806 def branches = "git branch --remote".execute().text.split("\n") | 806 def branches = "git branch --remote".execute().text.split("\n") |
807 .findAll { it.contains('release') || it.contains('hotfix') } | 807 .findAll { it.contains('release') || it.contains('hotfix') } |
808 .collect { it.replaceAll('\\s+', ' ').split(' ')[1].split('/')[2] - 'v' } | 808 .collect { it.replaceAll('\\s+', ' ').split('/').last() - 'v' } |
809 .collect { new Version(*it.split('\\.')*.toInteger()) } | 809 .collect { new Version(*it.split('\\.')*.toInteger()) } |
810 | 810 |
811 def results = (branches + versions).sort { v1, v2 -> v2 <=> v1 } | 811 def results = (branches + versions).sort { v1, v2 -> v2 <=> v1 } |
812 if (results.isEmpty()) { | 812 if (results.isEmpty()) { |
813 return new Version().nextSnapshot() | 813 return new Version().nextSnapshot() |