4

I have a gradle project. I want to add versioning to my index.html from gradle.properties by replacing @version@ token. I have tried the following:

build.properties

version=1.0.12 // i want this version
projectJdk=Oracle JDK 8

build.gradle

import org.apache.tools.ant.filters.*
processResources  {
    println 'here1 '
    filesMatching('static/index.html') {
        filter(ReplaceTokens, tokens: [version:  project.version])
        println 'here2' + project.version //this is printed meaning file the exists
    }
}

index.html

<span class="col-lg-offset-5">@version@</span>

index.html is under src/main/resources/static

Thanks,

DIMAKATSO BOPAPE
  • 153
  • 1
  • 2
  • 11

0 Answers0