@@ -101,21 +101,12 @@ private void applyUpgrades(GitHubRepository repository, List<String> issueLabels
101
101
Path gradleProperties = new File (getProject ().getRootProject ().getProjectDir (), "gradle.properties" ).toPath ();
102
102
UpgradeApplicator upgradeApplicator = new UpgradeApplicator (buildFile , gradleProperties );
103
103
List <Issue > existingUpgradeIssues = repository .findIssues (issueLabels , milestone );
104
+ System .out .println ("Applying upgrades..." );
105
+ System .out .println ("" );
104
106
for (Upgrade upgrade : upgrades ) {
107
+ System .out .println (upgrade .getLibrary ().getName () + " " + upgrade .getVersion ());
105
108
String title = issueTitle (upgrade );
106
109
Issue existingUpgradeIssue = findExistingUpgradeIssue (existingUpgradeIssues , upgrade );
107
- if (existingUpgradeIssue != null ) {
108
- if (existingUpgradeIssue .getState () == Issue .State .CLOSED ) {
109
- System .out .println (title + " (supersedes #" + existingUpgradeIssue .getNumber () + " "
110
- + existingUpgradeIssue .getTitle () + ")" );
111
- }
112
- else {
113
- System .out .println (title + " (completes existing upgrade)" );
114
- }
115
- }
116
- else {
117
- System .out .println (title );
118
- }
119
110
try {
120
111
Path modified = upgradeApplicator .apply (upgrade );
121
112
int issueNumber ;
@@ -130,16 +121,29 @@ private void applyUpgrades(GitHubRepository repository, List<String> issueLabels
130
121
existingUpgradeIssue .label (Arrays .asList ("type: task" , "status: superseded" ));
131
122
}
132
123
}
124
+ if (existingUpgradeIssue != null ) {
125
+ if (existingUpgradeIssue .getState () == Issue .State .CLOSED ) {
126
+ System .out .println (" Issue: " + issueNumber + " - " + title + " (supersedes #"
127
+ + existingUpgradeIssue .getNumber () + " " + existingUpgradeIssue .getTitle () + ")" );
128
+ }
129
+ else {
130
+ System .out
131
+ .println (" Issue: " + issueNumber + " - " + title + " (completes existing upgrade)" );
132
+ }
133
+ }
134
+ else {
135
+ System .out .println (" Issue: " + issueNumber + " - " + title );
136
+ }
133
137
if (new ProcessBuilder ().command ("git" , "add" , modified .toFile ().getAbsolutePath ())
134
138
.start ()
135
139
.waitFor () != 0 ) {
136
140
throw new IllegalStateException ("git add failed" );
137
141
}
138
- if (new ProcessBuilder ().command ("git" , "commit" , "-m" , commitMessage (upgrade , issueNumber ))
139
- .start ()
140
- .waitFor () != 0 ) {
142
+ String commitMessage = commitMessage (upgrade , issueNumber );
143
+ if (new ProcessBuilder ().command ("git" , "commit" , "-m" , commitMessage ).start ().waitFor () != 0 ) {
141
144
throw new IllegalStateException ("git commit failed" );
142
145
}
146
+ System .out .println (" Commit: " + commitMessage .substring (commitMessage .indexOf ('\n' )));
143
147
}
144
148
catch (IOException ex ) {
145
149
throw new TaskExecutionException (this , ex );
0 commit comments