clojure で Electoron できる descjop をやってみようと思った その3

Om を使うので別のプロジェクトを作る

+om を追加することで Om を使えるようにする。

% lein new descjop hello-om-based +om


Makefile に書こうかなーとか思ったんだけど、とりあえず bootstrap ってファイルに書いておく。

# -*- mode: shell-script; coding: utf-8; -*-

npm install

grunt download-electron

lein externs > ./app/js/externs.js

lein cljsbuild once


% ./bootstrap

そういえば、2 つビルドされている:

Compiling "app/js/cljsbuild-main.js" from ["src"]...
Successfully compiled "app/js/cljsbuild-main.js" in 19.467 seconds.
Compiling "app/js/front.js" from ["src_front"]...
Successfully compiled "app/js/front.js" in 10.117 seconds.

Figwheel サーバーの起動

Figwheel ってサーバーだったの?

% lein trampoline figwheel frontend


Figwheel: Starting server at http://localhost:3449
Focusing on build ids: frontend
Compiling "app/js/front.js" from ["src_front"]...
Successfully compiled "app/js/front.js" in 5.025 seconds.
Started Figwheel autobuilder

Launching ClojureScript REPL for build: frontend
Figwheel Controls:
          (stop-autobuild)                ;; stops Figwheel autobuilder
          (start-autobuild [id ...])      ;; starts autobuilder focused on optional ids
          (switch-to-build id ...)        ;; switches autobuilder to different build
          (reset-autobuild)               ;; stops, cleans, and starts autobuilder
          (reload-config)                 ;; reloads build config and resets autobuild
          (build-once [id ...])           ;; builds source one time
          (clean-builds [id ..])          ;; deletes compiled cljs target files
          (fig-status)                    ;; displays current state of system
          (add-dep [ "0.8.1"]) ;; add a dependency. very experimental
  Switch REPL build focus:
          :cljs/quit                      ;; allows you to switch REPL to another build
    Docs: (doc function-name-here)
    Exit: Control+C or :cljs/quit
 Results: Stored in vars *1, *2, *3, *e holds last exception object
Prompt will show when figwheel connects to your application


% ./electron/electron ./app/



Hello Om World! とは表示されなかった。