ã³ã³ãã¤ã«ä¸ã«é³æ¥½ãæµãã sbt ãã©ã°ã¤ã³ãä½ãã¾ããã
Scala ã®ã³ã³ãã¤ã«ãé
ã件ã¯ãScala ã³ã³ãã¤ã« é
ããã¨ãã§é©å½ã«ã°ã°ãã°ããã¨æãã¾ãã
https://twitter.com/search?q=Scala%20%E3%82%B3%E3%83%B3%E3%83%91%E3%82%A4%E3%83%AB%20%E9%81%85%E3%81%84
ã³ã³ãã¤ã«ãé
ãã¨éçºé度ãå½ç¶éãã¾ããããScala ã«ã¨ã£ã¦ã¯å¤§ããªèª²é¡ãªããã§ããããã¼ã¸ã§ã³ãä¸ããæ©è½ãå¢ãã¦ããã°è¡ãã»ã©ã³ã³ãã¤ã«æéã¯é·ããªãå¾åã«ããã¾ãã
ã¾ããã¯ãã implicit conversion ãªã©ã®ã³ã³ãã¤ã«æã«è§£æ±ºãè¡ããããªæ©è½ãå¤ç¨ããããã¦ãã³ã³ãã¤ã«æéã¯é·ããªãã¾ãã
解決çã¨ãã¦ã¯
- è¯ããã·ã³ãè²·ãã!!
ã§ãã
ã§ãè¯ããã·ã³ã使ã£ã¦ãé ãããã¯é ãã§ããã§ã解決çãèããã®ã§ãããæã£ããã§ããéã«èãããããããããªããã£ã¦ãã³ã³ãã¤ã«æéé·ããã£ã¦ããããããªããã£ã¦ã
ã¨ãããã㧠sbt-musical ã¨ãã SBT ãã©ã°ã¤ã³ãä½ãã¾ããã
https://github.com/tototoshi/sbt-musical
sbt-musical ã使ãã¨ãã«ãã®éã«é³æ¥½ãæµãã¾ãã
ã¤ã³ã¹ãã¼ã«
ã¾ããbash-itunes ã¨ããã³ãã³ãã©ã¤ã³ãã¼ã«ãã¤ã³ã¹ãã¼ã«ãã¦ããã¦ãã ããã
$ mkdir ~/bin # if not exists $ curl https://raw.github.com/illusori/bash-itunes/master/itunes > ~/bin/itunes && chmod 0755 !#:3
次㫠~/.sbt/plugins/build.sbt ã«æ¬¡ã®1è¡ãå ãã¾ãã
addSbtPlugin("com.github.tototoshi" % "sbt-musical" % "0.1.1")
以ä¸ã§ãã
注æç¹ã§ãããbash-itunes 㯠iTunes ã AppleScript ã§æä½ãã¦ããã®ã§ãMac ã§ããåãã¾ããã
sbt-musical ã§ã¯ bash-itunes ãã©ãããã scala-itunes (https://github.com/tototoshi/scala-itunes) ã使ã£ã¦ããã®ã§ãWindows 対å¿ããããã°ãscala-itunes ã« pull request ãã ããã
使ãæ¹
ãâªããã³ãã³ãã«é ã«ã¤ãã¾ãã
> ⪠compile
åãããããã§ãããããã¦ããã¶ã楽ãããªã³ãã³ãã«è¦ãã¾ãã
ããã§ã³ã³ãã¤ã«ãã¦ãéã«é³æ¥½ãæµãã¾ããã³ã³ãã¤ã«ãçµããã¨æ¢ã¾ãã¾ãã
ãâªãã¯ä»»æã®ã³ãã³ãã«å¯¾ãã¦ä½¿ãã¾ããä¾ãã°
> ⪠test
ããã§ãã¹ããã¦ãéã«é³æ¥½ãæµãã¾ãããã¹ããçµããã¨æ¢ã¾ãã¾ã
ã½ã¼ã¹ã®å¤æ´ãæ¤ç¥ãã¦ã³ãã³ããé£ç¶ã§å®è¡ãããã~ãã¨çµã¿åããããã¨ãå¯è½ã§ãã
> ⪠~compile
ã¤ãã§ãªæãã§ãããiTunes ã®ç°¡åãªæä½ãããã³ãã³ããã¤ãã¦ãã¾ãã
åç
> itunes-play
ä¸æåæ¢
> itunes-pause
é³éè¨å®
> itunes-vol 50
ã¾ãã¯
> itunes-vol up/down
å¹æ
ããã§ãã³ã³ãã¤ã«æéã®éã«å¥½ããªé³æ¥½ãæµããããã«ãªãã®ã§ãã³ã³ãã¤ã«ã楽ãããªãã¾ããã³ã³ãã¤ã«æéãé·ããªãã»ã©é³æ¥½ãããããèãã¾ããã¨ãããã³ã³ãã¤ã«æéãçãã¨æ²ãç´°åãã«ãªããããã®ã§éã«ã¤ã©ã¤ã©ãã¦ãã¾ãï¼
é¸æ²ã«ã¤ãã¦ã¯ãä»»ããã¾ãããå²ãã¨ãã³ã·ã§ã³ã®ä¸ããæ²ã®ã»ããããã³ã³ãã¤ã«ã¯ãã¾ã£ãããããï¼ï¼ï¼ãæãããã®ã§ãªã¹ã¹ã¡ã§ããéã«è½ã¡çããã人ã¯ãçµã§ãæµãã°ããããããªãã£ãããã
ãã¨ä½ã£ã¦åãã¦æ°ãã¤ãããã§ãããã³ã³ãã¤ã«ãçµããã¨é³æ¥½ãæ¢ã¾ãã®ã§ããã³ã³ãã¤ã«ãªãããããã¨ããããµã¼ãã£ã³ãå§ãã¦ãã³ã³ãã¤ã«ãçµãã£ãã®ã«ããæ°ã¥ãã®ã§æéãç¡é§ã«ãã¾ããã
ãã㧠Scala ã®ã³ã³ãã¤ã«æéã®é·ãã¯è§£æ±ºããã¾ãã(æè¨)ãçããããããã³ã³ãã¤ã«ãã¾ãããã