3
아래와 같이 CSS 파일의 URL을 변환 할 때 regex를 사용할 수 있습니까? 나는 글꼴 이름을 하드 코드하고 싶지 않다.Gradle/Java 대체 텍스트
에서 :
url("#{resource['css:../fonts/glyphiconshalflings-regular.eot']}?#iefix") format('embedded-opentype')
그리고 이것은 내가 현재 가지고있는 것입니다 :
url('../fonts/glyphiconshalflings-regular.eot?#iefix') format('embedded-opentype')
에
task fixCSSResources << {
FileTree cssFiles = fileTree("src/main/webapp") {
include "**/*.css"
}
cssFiles.each { File cssFile ->
String content = cssFile.getText("UTF-8")
// what to do here?
cssFile.write(content, "UTF-8")
}
}
텍스트의 패턴은 무엇입니까? 항상 'URL (무언가) 형식 (무언가)'이 될 것입니까? –
@SongCGGao here 's example http://pastebin.com/VzmaFrMJ – perak