@@ -33,22 +33,22 @@ def projectDir = Paths.get("").toAbsolutePath().normalize().toString()
3333// ---------------------------------
3434// Read properties from project.properties
3535// ---------------------------------
36- def propertiesPath = Paths . get(projectDir, ' .' , ' project.properties' )
37- def properties = new Properties ()
36+ def projectPropertiesPath = Paths . get(projectDir, ' .' , ' project.properties' )
37+ def projectProperties = new Properties ()
3838
3939try {
40- properties . load(Files . newInputStream(propertiesPath ))
40+ projectProperties . load(Files . newInputStream(projectPropertiesPath ))
4141} catch (IOException e) {
42- println (" Error: Unable to load 'project.properties'. Please ensure the file exists at ${ propertiesPath } ." )
42+ println (" Error: Unable to load 'project.properties'. Please ensure the file exists at ${ projectPropertiesPath } ." )
4343 return
4444}
4545
4646// ---------------------------------
4747// user, repo and i18n from properties
4848// ---------------------------------
49- def user = properties [' github.repo.user' ]
50- def repo = properties [' github.repo.name' ]
51- def i18n = properties [' i18n' ]
49+ def user = projectProperties [' github.repo.user' ]
50+ def repo = projectProperties [' github.repo.name' ]
51+ def i18n = projectProperties [' i18n' ]
5252
5353def i18nPropertiesPath = Paths . get(projectDir, ' i18n' , " ${ i18n} .properties" )
5454def i18nProperties = new Properties ()
6262
6363def projectTitle = i18nProperties[' project.title' ]
6464def projectDescription = i18nProperties[' project.description' ]
65-
66- println (" projectTitle:${ projectTitle} " )
67- println (" projectDescription:${ projectDescription} " )
65+ def projectChangeLogDescription = i18nProperties[' label.project.change.log' ]
66+ def currenceVersionDescription = i18nProperties[' label.current.version' ]
6867
6968// ---------------------------------
7069// Executes the Git command to get the list of commits with hash, date, author, and message
@@ -129,12 +128,21 @@ commits.each { commit ->
129128 def commitUrl = " https://github.com/${ user} /${ repo} /commit/${ commitHash} "
130129 lastCommitUrl = " https://github.com/${ user} /${ repo} /commit/${ commitHash} "
131130
132- // Ignore commits with the keyword "AUTO_COMMIT"
133- if (message. contains(" AUTO_COMMIT" ) || message. contains(" AUTO_CHANGELOG" )) {
131+ // ---------------------------------
132+ // Array of keywords to ignore
133+ // ---------------------------------
134+ def ignoreKeywords = [" AUTO_COMMIT" , " AUTO_CHANGELOG" ]
135+
136+ // ---------------------------------
137+ // Ignore commits with specified keywords
138+ // ---------------------------------
139+ if (ignoreKeywords. any { keyword -> message. contains(keyword) }) {
134140 return // Continue to next commit
135141 }
136142
143+ // ---------------------------------
137144 // Increment the version for each valid commit
145+ // ---------------------------------
138146 def version = " [${ major} .${ minor} .${ patch} ](${ commitUrl} )"
139147 lastVersion = " ${ major} .${ minor} .${ patch} "
140148 lastDate = date
@@ -158,9 +166,10 @@ commits.each { commit ->
158166// ---------------------------------
159167def header = new StringBuilder ()
160168header. append("""
161- # Project Change Log
169+ # ${ projectTitle} - ${ projectChangeLogDescription}
170+
171+ **${ currenceVersionDescription} :** [${ lastVersion} ](${ lastCommitUrl} ) (${ lastAuthor} ) - ${ lastDate}
162172
163- **Current version:** [${ lastVersion} ](${ lastCommitUrl} ) (${ lastAuthor} ) - ${ lastDate}
164173---
165174""" )
166175
0 commit comments