Spring Boot ã§ã¡ã¼ã«éä¿¡ãã Web ã¢ããªã±ã¼ã·ã§ã³ãä½ã ( ãã®ï¼ï¼ )( DataSource Bean ã®ç¬èªå®ç¾©ã¯ä¸è¦ï¼ä» )
æ¦è¦
Spring Boot ã§ã¡ã¼ã«éä¿¡ãã Web ã¢ããªã±ã¼ã·ã§ã³ãä½ã ( ãã®ï¼ )( ã¡ã¼ã«éä¿¡ç»é¢ã®ä½æï¼ ) ã®ç¶ãã§ãã
-
ããããä¿®æ£ãããé¨åããã£ãã®ã§ãã¡ã¼ã«éä¿¡ç»é¢ã®ä½æãä¸æä¸æãã¦ä¿®æ£ä½æ¥ãè¡ãã¾ãã
-
ä»åã®æé ã§ç¢ºèªã§ããã®ã¯ä»¥ä¸ã®å 容ã§ãã
- 以ä¸ã®ç¹ã調æ»ã»ä¿®æ£ãã¾ãã
- Spring Boot ã§ã¡ã¼ã«éä¿¡ãã Web ã¢ããªã±ã¼ã·ã§ã³ãä½ã ( çªå¤ç·¨ )( DataSource Bean ã« application.properties ã®è¨å®ãåæ ãããä»çµã¿ã¨ã¯ï¼ )㧠DataSourceAutoConfiguration.java 㧠DataSource Bean ãèªåçæããããã¨ã«æ°ã¥ããã®ã§ãApplicationConfig ã¯ã©ã¹ã§å®ç¾©ããªãã¦ãããã確èªãã¾ãã
- DataSourceAutoConfiguration.java ãè¦ã¦ãã¤ã³ãã¼ã¯ã©ã¹ã« @Configuration ã¢ããã¼ã·ã§ã³ãä»å ãããã®ä¸ã§ Bean ãçæåºæ¥ããã¨ã«æ°ã¥ããã®ã§ãä»ã® DomaBeanConfig ã¯ã©ã¹ã DomaConfig ã¯ã©ã¹ã®ã¤ã³ãã¼ã¯ã©ã¹ã«åºæ¥ãªãã確èªãã¾ããDomaBeanConfig ã¯ã©ã¹ã¨ DomaConfig ã¯ã©ã¹ã¯åºæ¥ãã°ï¼ã¤ã«ãããã¨èãã¦ãã¾ããã
- MAIL001MailBuilder ã¯ã©ã¹ã以ä¸ã®ããã«ä½ãç´ãã¾ãã
- package ã ksbysample.webapp.email.web.mailsend â ksbysample.webapp.email.helper.mail ã¸ç§»åãã¾ãã
- ã¯ã©ã¹åã MAIL001MailBuilder â MAIL001MailHelper ã¸å¤æ´ãã¾ãã
- MAIL001MailHelper ã¯ã©ã¹ã« @Component ã¢ããã¼ã·ã§ã³ãä»å ãã¾ãã
- Velocity ã®ãã³ãã¬ã¼ããã¡ã¤ã«ã®ãã¹ãã»ãããããã£ã¼ã«ã templateLocation 㯠MAIL001MailHelper ã¯ã©ã¹å 㧠private final String ã§å®æ°ã¨ãã¦å®ç¾©ãã¾ãã
- VelocityUtils ã¯ã©ã¹ãã¡ã½ããã§ã»ããããã®ã§ã¯ãªã @Autowired 㧠DI ããã¾ãã
- build ã¡ã½ãããåé¤ããcreate ã¡ã½ããã¯ã¡ã½ããåã createMessage ã¸å¤æ´ãã¾ãã
- å¤æ° mailsendForm 㯠createMessage ã¡ã½ããã®å¼æ°ã§åãåãã¾ãã
- Doma-Gen ã§èªåçæãã Dao ã¯ã©ã¹ãEntity ã¯ã©ã¹ã®ãã¡ã¤ã«ã Gradle ã® gen ã¿ã¹ã¯å 㧠git add ãããæ¹æ³ãããã®ã調æ»ãã¾ãã
- 以ä¸ã®ç¹ã調æ»ã»ä¿®æ£ãã¾ãã
ã½ããã¦ã§ã¢ä¸è¦§
åèã«ãããµã¤ã
Gradle Goodness: Use Git Commit Id in Build Script
http://mrhaki.blogspot.jp/2015/04/gradle-goodness-use-git-commit-id-in.html- build.gradle å 㧠git ã¬ãã¸ããªã«ã¢ã¯ã»ã¹ããæ¹æ³ ( Grgit ã使ç¨ãã ) ãåèã«ãã¾ããã
grgit 1.1.0 API
http://ajoberstar.org/grgit/docs/groovydoc/index.htmldomaframework/master/build.gradle
https://github.com/domaframework/master/blob/master/build.gradle
æé
DataSource Bean ãå®ç¾©ããå¿ è¦ã¯ãªãã®ã§ã¯ãªããï¼
IntelliJ IDEA 㧠1.0.x-delete-datasource-bean ãã©ã³ããä½æãã¾ãã
src/main/java/ksbysample/webapp/email/config ã®ä¸ã® ApplicationConfig.java ã ãªã³ã¯å ã®å 容 ã«å¤æ´ãã¾ãã
åä½ç¢ºèªãã¾ããGradle projects View ãã bootRun ã¿ã¹ã¯ãå®è¡ã㦠Tomcat ãèµ·åãã¾ããæ£å¸¸ã«èµ·åã㦠"Started Application in ..." ã®ãã°ãåºåããããã¨ã確èªã§ãã¾ãã
ãã©ã¦ã¶ãèµ·åã http://localhost:8080/mailsend ã¸ã¢ã¯ã»ã¹ãã¾ãã以ä¸ã®ç»åã®å¤ãå ¥åå¾ããéä¿¡ããã¿ã³ãã¯ãªãã¯ãã¾ãã
ã¨ã©ã¼ã¯çºçãããã¡ã¼ã«ãéä¿¡ããã¾ãããemail, email_item ã©ã¡ãã®ãã¼ãã«ã«ããã¼ã¿ãä¿åããã¦ãã¾ãããDataSource Bean ã®å®ç¾©ãåé¤ãã¦ãåé¡ãªãããã§ãã
Run View 㧠Ctrl+F2 ãæ¼ã㦠Tomcat ãåæ¢ãã¾ãã
commitãGitHub 㸠Pushã1.0.x-delete-datasource-bean -> 1.0.x 㸠Pull Requestã1.0.x ã§ãã¼ã¸ã1.0.x-delete-datasource-bean ãã©ã³ããåé¤ãããã¾ãã
DomaBeanConfig ã¯ã©ã¹ã DomaConfig ã¯ã©ã¹ã®ã¤ã³ãã¼ã¯ã©ã¹ã¨ãã¦å®ç¾©ã§ãããï¼
IntelliJ IDEA 㧠1.0.x-change-innerclass-domabeanconfig ãã©ã³ããä½æãã¾ãã
src/main/java/ksbysample/webapp/email/config ã®ä¸ã® DomaConfig.java ã ãªã³ã¯å ã®å 容 ã«å¤æ´ãã¾ãã
src/main/java/ksbysample/webapp/email/config ã®ä¸ã® DomaBeanConfig.java ãåé¤ãã¾ãã
åä½ç¢ºèªãã¾ããGradle projects View ãã bootRun ã¿ã¹ã¯ãå®è¡ã㦠Tomcat ãèµ·åãã¾ããæ£å¸¸ã«èµ·åã㦠"Started Application in ..." ã®ãã°ãåºåããããã¨ã確èªã§ãã¾ãã
ãã©ã¦ã¶ãèµ·åã http://localhost:8080/mailsend ã¸ã¢ã¯ã»ã¹ãã¾ãããDataSource Bean ãå®ç¾©ããå¿ è¦ã¯ãªãã®ã§ã¯ãªããï¼ãã®ç»åã®ãã¹ããã¼ã¿ã®å¤ãå ¥åå¾ããéä¿¡ããã¿ã³ãã¯ãªãã¯ãã¾ãã
ã¨ã©ã¼ã¯çºçãããã¡ã¼ã«ãéä¿¡ããã¾ãããemail, email_item ã©ã¡ãã®ãã¼ãã«ã«ããã¼ã¿ãä¿åããã¦ãã¾ãããDomaBeanConfig ã¯ã©ã¹ã DomaConfig ã¯ã©ã¹ã®ã¤ã³ãã¼ã¯ã©ã¹ã§å®ç¾©ãã¦ãåé¡ãªãããã§ãã
Run View 㧠Ctrl+F2 ãæ¼ã㦠Tomcat ãåæ¢ãã¾ãã
commitãGitHub 㸠Pushã1.0.x-change-innerclass-domabeanconfig -> 1.0.x 㸠Pull Requestã1.0.x ã§ãã¼ã¸ã1.0.x-change-innerclass-domabeanconfig ãã©ã³ããåé¤ãããã¾ãã
MAIL001MailBuilder ã¯ã©ã¹ãä½ãç´ã
IntelliJ IDEA 㧠1.0.x-remake-mail001mailbuilder ãã©ã³ããä½æãã¾ãã
src/main/java/ksbysample/webapp/email/web/mailsend ã®ä¸ã® MAIL001MailBuilder ãé¸æå¾ãShift+F6 ãæ¼ãã¦ãRenameããã¤ã¢ãã°ã表示ããå¾ãMAIL001MailHelper ã¸ãªãã¼ã ãã¾ãã
src/main/java/ksbysample/webapp/email/web/mailsend ã®ä¸ã® MAIL001MailHelper ãé¸æå¾ãF6 ãæ¼ãã¦ãMoveããã¤ã¢ãã°ã表示ããå¾ãksbysample.webapp.email.helper.mail ã¸ç§»åãã¾ãã
ä¸ã®ãã¤ã¢ãã°ã§ãRefactorããã¿ã³ãæ¼ãã¨ç¢ºèªãã¤ã¢ãã°ã表示ããã¦ãYesããã¿ã³ãæ¼ãã¨åå¨ããªã package ãä½æãã¦ããã¾ãã
src/main/java/ksbysample/webapp/email/helper/mail ã®ä¸ã® MAIL001MailHelper.java ã ãªã³ã¯å ã®å 容 ã«å¤æ´ãã¾ãã
src/main/java/ksbysample/webapp/email/web/mailsend ã®ä¸ã® MailsendService.java ã ãªã³ã¯å ã®å 容 ã«å¤æ´ãã¾ãã
åä½ç¢ºèªãã¾ããGradle projects View ãã bootRun ã¿ã¹ã¯ãå®è¡ã㦠Tomcat ãèµ·åãã¾ãã
ãã©ã¦ã¶ãèµ·åã http://localhost:8080/mailsend ã¸ã¢ã¯ã»ã¹ãã¾ãããDataSource Bean ãå®ç¾©ããå¿ è¦ã¯ãªãã®ã§ã¯ãªããï¼ãã®ç»åã®ãã¹ããã¼ã¿ã®å¤ãå ¥åå¾ããéä¿¡ããã¿ã³ãã¯ãªãã¯ãã¾ãã
ã¨ã©ã¼ã¯çºçãããã¡ã¼ã«ãéä¿¡ããã¾ãããemail, email_item ã©ã¡ãã®ãã¼ãã«ã«ããã¼ã¿ãä¿åããã¦ãã¾ããã
Run View 㧠Ctrl+F2 ãæ¼ã㦠Tomcat ãåæ¢ãã¾ãã
commitãGitHub 㸠Pushã1.0.x-remake-mail001mailbuilder -> 1.0.x 㸠Pull Requestã1.0.x ã§ãã¼ã¸ã1.0.x-remake-mail001mailbuilder ãã©ã³ããåé¤ãããã¾ãã
Doma-Gen ã§èªåçæãããã¡ã¤ã«ãèªå㧠git add ãã
IntelliJ IDEA 㧠1.0.x-gitadd-domagenfile ãã©ã³ããä½æãã¾ãã
build.gradle ã ãªã³ã¯å ã®å 容 ã«å¤æ´ãã¾ãã
Gradle projects View ã®å·¦ä¸ã«ãããRefresh all Gradle projectsãã¢ã¤ã³ã³ãã¯ãªãã¯ãã¦ãå¤æ´ãã build.gradle ã®å 容ãåæ ãã¾ãã
åä½ç¢ºèªãã¾ããæåã« src/main/java/ksbysample/webapp/email ã®ä¸ã® dao ã®ä¸ã« TestDao ã¤ã³ã¿ã¼ãã§ã¼ã¹ããentity ã®ä¸ã« TestEntity ã¯ã©ã¹ãæåã§ä½æãã¾ãããã®æãAdd File to Gitããã¤ã¢ãã°ãåºãããNoããã¿ã³ãã¯ãªãã¯ãã¦è¿½å ããªãããã«ãã¾ãã
ãã®æç¹ã§ã¡ã¤ã³ã¡ãã¥ã¼ãããVCSã-ãCommit Changes...ããé¸æãã¦ãCommit Changesããã¤ã¢ãã°ã表示ãã¦ã TestDao, TestEntity ã¯è¡¨ç¤ºããã¾ããããCancelããã¿ã³ãã¯ãªãã¯ãã¦ãã¤ã¢ãã°ãéãã¾ãã
次㫠gen ã¿ã¹ã¯ãå®è¡ãã¾ãã
å度ã¡ã¤ã³ã¡ãã¥ã¼ãããVCSã-ãCommit Changes...ããé¸æãã¦ãCommit Changesããã¤ã¢ãã°ã表示ããã¨ãä»åº¦ã¯ git add ããã¦ããã®ã§è¡¨ç¤ºããã¾ãããCancelããã¿ã³ãã¯ãªãã¯ãã¦ãã¤ã¢ãã°ãéãã¾ãã
ä½æãã TestDao ã¤ã³ã¿ã¼ãã§ã¼ã¹ãTestEntity ã¯ã©ã¹ãåé¤ãã¾ãã
commitãGitHub 㸠Pushã1.0.x-gitadd-domagenfile -> 1.0.x 㸠Pull Requestã1.0.x ã§ãã¼ã¸ã1.0.x-gitadd-domagenfile ãã©ã³ããåé¤ãããã¾ãã
- commit æã« Code Analysis ãã¤ã¢ãã°ã表示ããã¾ããã表示ããã Warning ãUnnecessary qualified referenceãã¨ã'open' in 'org.ajoberstar.grgit.Grgit' cannot be applied to
(['dir':java.io.File])
ãã®å¯¾å¦æ¹æ³ãåãããªãã£ãããããCommitããã¿ã³ãã¯ãªãã¯ãã¦å ã«é²ãã¾ãã
- commit æã« Code Analysis ãã¤ã¢ãã°ã表示ããã¾ããã表示ããã Warning ãUnnecessary qualified referenceãã¨ã'open' in 'org.ajoberstar.grgit.Grgit' cannot be applied to
次åã¯ããã
- ã¡ã¼ã«éä¿¡ç»é¢ã§ä½æããã¢ã¸ã¥ã¼ã«ã®ãã¹ããæ¸ãã¾ãã
- ã¡ã¼ã«ã® unit test ç¨ã®ã©ã¤ãã©ãªããããããªã®ã§ã使ç¨ãã¦ã¿ãäºå®ã§ãã
ã½ã¼ã¹ã³ã¼ã
ApplicationConfig.java
package ksbysample.webapp.email.config; import org.springframework.context.annotation.Configuration; @Configuration public class ApplicationConfig { }
- DataSource Bean ã®å®ç¾©ãåé¤ãã¾ãã
- ApplicationConfig.java 㯠Bean å®ç¾©ç¨ã¨ãã¦ãã®ã¾ã¾æ®ãã¦ããã¾ãã
DomaConfig.java
package ksbysample.webapp.email.config; import org.seasar.doma.jdbc.Config; import org.seasar.doma.jdbc.dialect.Dialect; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy; import org.springframework.stereotype.Component; import javax.sql.DataSource; @Component public class DomaConfig implements Config { private DataSource dataSource; @Autowired private Dialect dialect; @Autowired public void setDataSource(DataSource dataSource) { this.dataSource = new TransactionAwareDataSourceProxy(dataSource); } @Override public DataSource getDataSource() { return this.dataSource; } @Override public Dialect getDialect() { return this.dialect; } @Configuration protected static class DomaBeanConfig { @Value("${doma.dialect}") private String domaDialect; @Bean public Dialect dialect() throws ClassNotFoundException, IllegalAccessException, InstantiationException { return (Dialect)Class.forName(domaDialect).newInstance(); } } }
protected static class DomaBeanConfig { ... }
ã追å ãã¾ããDomaBeanConfig ã¯ã©ã¹ã«ã¯ @Configuration ãä»å ãã¾ãã
MAIL001MailHelper.java
package ksbysample.webapp.email.helper.mail; import ksbysample.webapp.email.config.Constant; import ksbysample.webapp.email.util.VelocityUtils; import ksbysample.webapp.email.web.mailsend.MailsendForm; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.SimpleMailMessage; import org.springframework.stereotype.Component; import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; @Component public class MAIL001MailHelper { private final String templateLocation = "mail/MAIL001/MAIL001-body.vm"; @Autowired private VelocityUtils velocityUtils; public SimpleMailMessage createMessage(MailsendForm mailsendForm) { SimpleMailMessage mailMessage = new SimpleMailMessage(); mailMessage.setFrom(mailsendForm.getFromAddr()); mailMessage.setTo(mailsendForm.getToAddr()); mailMessage.setSubject(mailsendForm.getSubject()); mailMessage.setText(generateTextUsingVelocity(mailsendForm)); return mailMessage; } private String generateTextUsingVelocity(MailsendForm mailsendForm) { Constant constant = Constant.getInstance(); Map<String, Object> model = new HashMap<>(); model.put("name", mailsendForm.getName()); model.put("sex", constant.SEX_MAP.get(mailsendForm.getSex())); model.put("type", constant.TYPE_MAP.get(mailsendForm.getType())); String itemList = mailsendForm.getItem().stream() .map(constant.ITEM_MAP::get) .collect(Collectors.joining(", ")); model.put("item", itemList); model.put("naiyo", mailsendForm.getNaiyo()); return velocityUtils.merge(this.templateLocation, model); } }
- ã¯ã©ã¹ã« @Component ã¢ããã¼ã·ã§ã³ãä»å ãã¾ãã
private String templateLocation;
âprivate final String templateLocation = "mail/MAIL001/MAIL001-body.vm";
ã¸å¤æ´ãã¾ããprivate VelocityUtils velocityUtils;
ã追å ãã¾ãã- build, setForm, setVelocityUtils, setTemplateLocation ã¡ã½ãããåé¤ãã¾ãã
- ã¡ã½ããåã create â createMessage ã¸å¤æ´ãã¾ãã
- createMessage ã¡ã½ããã®å®è£ ãä¸è¨ã®å 容ã«å¤æ´ãã¾ãã
- generateTextUsingVelocity ã¡ã½ããã追å ããã¡ã¼ã«æ¬æã®çæå¦çããã®ã¡ã½ããã«ç§»åãã¾ãã
MailsendService.java
package ksbysample.webapp.email.web.mailsend; import ksbysample.webapp.email.dao.EmailDao; import ksbysample.webapp.email.dao.EmailItemDao; import ksbysample.webapp.email.entity.Email; import ksbysample.webapp.email.entity.EmailItem; import ksbysample.webapp.email.helper.mail.MAIL001MailHelper; import ksbysample.webapp.email.service.EmailService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.SimpleMailMessage; import org.springframework.stereotype.Service; @Service public class MailsendService { @Autowired private EmailDao emailDao; @Autowired private EmailItemDao emailItemDao; @Autowired private MAIL001MailHelper mail001MailHelper; @Autowired private EmailService emailService; public void saveAndSendEmail(MailsendForm mailsendForm) { // å ¥åããããã¼ã¿ã email, email_item ãã¼ãã«ã«ä¿åãã saveEmail(mailsendForm); // ã¡ã¼ã«ãéä¿¡ãã sendEmail(mailsendForm); } public void saveEmail(MailsendForm mailsendForm) { // email ãã¼ãã«ã«ä¿åãã Email email = new Email(); BeanUtils.copyProperties(mailsendForm, email); emailDao.insert(email); // email_item ãã¼ãã«ã«ä¿åãã EmailItem emailItem = new EmailItem(); for (String item : mailsendForm.getItem()) { emailItem.setEmailItemId(null); emailItem.setEmailId(email.getEmailId()); emailItem.setItem(item); emailItemDao.insert(emailItem); } } public void sendEmail(MailsendForm mailsendForm) { SimpleMailMessage mailMessage = mail001MailHelper.createMessage(mailsendForm); emailService.sendSimpleMail(mailMessage); } }
private VelocityUtils velocityUtils;
ãåé¤ãã¾ããprivate MAIL001MailHelper mail001MailHelper;
ã追å ãã¾ãã- sendEmail ã¡ã½ããã®å®è£ ãä¸è¨ã®å 容ã«å¤æ´ãã¾ãã
build.gradle
buildscript { repositories { jcenter() // for org.springframework:springloaded maven { url "http://repo.spring.io/repo/" } } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.3.RELEASE") classpath("org.springframework:springloaded:1.2.3.RELEASE") // for Grgit classpath("org.ajoberstar:grgit:1.1.0") } } apply plugin: 'java' apply plugin: 'spring-boot' apply plugin: 'idea' // for Doma 2 // Javaã¯ã©ã¹ã¨SQLãã¡ã¤ã«ã®åºåå ãã£ã¬ã¯ããªãåãã«ãã processResources.destinationDir = compileJava.destinationDir // ã³ã³ãã¤ã«ããåã«SQLãã¡ã¤ã«ãåºåå ãã£ã¬ã¯ããªã«ã³ãã¼ããããã«ä¾åé¢ä¿ãé転ãã compileJava.dependsOn processResources ext { git = org.ajoberstar.grgit.Grgit.open(file('.')) } jar { baseName = 'ksbysample-webapp-email' version = '0.0.1-SNAPSHOT' } idea { module { inheritOutputDirs = false outputDir = file("$buildDir/classes/main/") } } configurations { domaGenRuntime } repositories { jcenter() // for org.seasar.doma:doma maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { def jdbcDriver = "org.postgresql:postgresql:9.4-1201-jdbc41" // spring-boot-gradle-plugin ã«ãããã¼ã¸ã§ã³çªå·ãèªåã§è¨å®ããããã® // Appendix E. Dependency versions ( http://docs.spring.io/spring-boot/docs/current/reference/html/appendix-dependency-versions.html ) åç § compile("org.springframework.boot:spring-boot-starter-web") compile("org.springframework.boot:spring-boot-starter-thymeleaf") compile("org.springframework.boot:spring-boot-starter-data-jpa") compile("org.springframework.boot:spring-boot-starter-velocity") compile("org.springframework.boot:spring-boot-starter-mail") compile("org.codehaus.janino:janino") testCompile("org.springframework.boot:spring-boot-starter-test") testCompile("org.yaml:snakeyaml") // spring-boot-gradle-plugin ã«ãããã¼ã¸ã§ã³çªå·ãèªåã§è¨å®ãããªããã® compile("${jdbcDriver}") compile("org.seasar.doma:doma:2.2.0") compile("org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16") compile("org.apache.commons:commons-lang3:3.4") compile("org.projectlombok:lombok:1.16.2") testCompile("org.dbunit:dbunit:2.5.0") // for Doma-Gen domaGenRuntime("org.seasar.doma:doma-gen:2.2.0") domaGenRuntime("${jdbcDriver}") } bootRun { jvmArgs = ['-Dspring.profiles.active=develop'] } test { jvmArgs = ['-Dspring.profiles.active=unittest'] } // for Doma-Gen task gen << { def rootPackageName = 'ksbysample.webapp.email' ant.taskdef(resource: 'domagentask.properties', classpath: configurations.domaGenRuntime.asPath) ant.gen(url: 'jdbc:postgresql://localhost/ksbyemail', user: 'ksbyemail_user', password: 'xxxxxxxx') { entityConfig(packageName: "${rootPackageName}.entity", useListener: false) daoConfig(packageName: "${rootPackageName}.dao") sqlConfig() // èªåçæãããã¡ã¤ã«ã git add ãã def grgit = org.ajoberstar.grgit.Grgit.open(dir: project.projectDir) grgit.add(patterns: ['.']) } }
- buildscript ã® dependencies ã®ä¸ã«
classpath("org.ajoberstar:grgit:1.1.0")
ã追å ãã¾ãã - task gen ã®æå¾ã« grgit 㧠add ããå¦çã追å ãã¾ãã
å±¥æ´
2015/05/13
åççºè¡ã