2/06/2012

build groovy อย่างง่ายด้วย gradle

gradle เป็นเครื่องมือจัดการ dependencies คล้าย maven ซึ่งเขียนโดย groovy ซึ่งใช้ feature DSL (Domain Specific Language) ซึ่งขั้นตอนง่ายมากเพียงแค่สร้าง build.gradle แล้วพิมพ์ลงไปในไฟล์ดังน้ี

apply plugin: 'groovy'
repositories {
  mavenCentral()
}
dependencies {
  groovy group: 'org.codehaus.groovy', name: 'groovy', version: '1.8.5'
  testCompile group: 'junit', name: 'junit', version: '4.10'
}

หลังจากนั้นบันทึกไฟล์ แล้วใช้คำสั่ง
gradle build

กระบวนการหลังจากนั้นมันก็จะโหลด dependencies แล้ว build source code ให้เอง

No comments :

Post a Comment