/
projectmodel.clj
53 lines (41 loc) · 1.36 KB
/
projectmodel.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
(ns damp.ekeko.soot.projectmodel
(:import
[damp.ekeko.soot SootProjectModel])
(:require
[damp.ekeko [ekekomodel :as ekekomodel]]
[damp.ekeko.workspace [workspace :as workspace]]
))
(defn
soot-project-models
"Returns all SootProjectModel instances that are to be queried.
Subset of (queried-project-models), which is itself
a subset of (all-project-models)."
[]
(filter (fn [project-model] (instance? SootProjectModel project-model))
(ekekomodel/queried-project-models)))
(defn
^SootProjectModel
current-soot-model
"Currently, there should only be one SootProjectModel as Soot itself
relies on global state internally."
[]
(first (soot-project-models)))
(def sootnature (damp.ekeko.soot.SootNature/NATURE_ID))
(defn
enable-soot-nature!
"Enables Ekeko's Soot nature on the given project.
Side effects: will start the whole-program analysis,
nature will be disabled for all other projects."
[project]
(workspace/enable-project-nature! project sootnature)
(workspace/build-project project))
(defn
disable-soot-nature!
"Disables Ekeko's Soot nature for the given project."
[project]
(workspace/disable-project-nature! project sootnature))
(defn
workspace-disable-soot!
"Disables Ekeko'Soot nature on all workspace projects."
[]
(damp.util.Natures/removeNatureFromAllProjects sootnature))