author | wenzelm |
Sat, 17 Jul 2021 21:31:15 +0200 | |
changeset 74030 | 39e05601faeb |
parent 73987 | fc363a3b690a |
child 74032 | c9ec6f03ab91 |
permissions | -rw-r--r-- |
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
1 |
/* Title: Pure/Tools/scala_project.scala |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
2 |
Author: Makarius |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
3 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
4 |
Setup Gradle project for Isabelle/Scala/jEdit. |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
5 |
*/ |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
6 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
7 |
package isabelle |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
8 |
|
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
9 |
import scala.jdk.CollectionConverters._ |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
10 |
|
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
11 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
12 |
object Scala_Project |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
13 |
{ |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
14 |
/* groovy syntax */ |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
15 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
16 |
def groovy_string(s: String): String = |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
17 |
{ |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
18 |
s.map(c => |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
19 |
c match { |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
20 |
case '\t' | '\b' | '\n' | '\r' | '\f' | '\\' | '\'' | '"' => "\\" + c |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
21 |
case _ => c.toString |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
22 |
}).mkString("'", "", "'") |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
23 |
} |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
24 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
25 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
26 |
/* file and directories */ |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
27 |
|
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
28 |
lazy val isabelle_files: (List[Path], List[Path]) = |
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
29 |
{ |
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
30 |
val component_contexts = |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
31 |
isabelle.setup.Build.component_contexts().asScala.toList |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
32 |
|
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
33 |
val jars1 = Path.split(Isabelle_System.getenv("ISABELLE_CLASSPATH")) |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
34 |
val jars2 = |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
35 |
(for { |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
36 |
context <- component_contexts.iterator |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
37 |
s <- context.requirements().asScala.iterator |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
38 |
path <- context.requirement_paths(s).asScala.iterator |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
39 |
} yield File.path(path.toFile)).toList |
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
40 |
|
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
41 |
val jar_files = |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
42 |
(jars1 ::: jars2).filterNot(path => |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
43 |
component_contexts.exists(context => |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
44 |
{ |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
45 |
val name: String = context.module_name() |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
46 |
name.nonEmpty && File.eq(context.path(name).toFile, path.file) |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
47 |
})) |
73987
fc363a3b690a
build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents:
73912
diff
changeset
|
48 |
|
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
49 |
val source_files = |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
50 |
(for { |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
51 |
context <- component_contexts.iterator |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
52 |
file <- context.sources.asScala.iterator |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
53 |
if file.endsWith(".scala") || file.endsWith(".java") |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
54 |
} yield File.path(context.path(file).toFile)).toList |
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
55 |
|
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
56 |
(jar_files, source_files) |
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
57 |
} |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
58 |
|
72762 | 59 |
lazy val isabelle_scala_files: Map[String, Path] = |
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
60 |
{ |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
61 |
val context = isabelle.setup.Build.component_context(Path.ISABELLE_HOME.java_path) |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
62 |
context.sources().asScala.iterator.foldLeft(Map.empty[String, Path]) { |
72762 | 63 |
case (map, name) => |
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
64 |
if (name.endsWith(".scala")) { |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
65 |
val path = File.path(context.path(name).toFile) |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
66 |
val base = path.base.implode |
72762 | 67 |
map.get(base) match { |
68 |
case None => map + (base -> path) |
|
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
69 |
case Some(path2) => error("Conflicting base names: " + path + " vs. " + path2) |
72762 | 70 |
} |
71 |
} |
|
72 |
else map |
|
73359 | 73 |
} |
73675 | 74 |
} |
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
75 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
76 |
|
72755 | 77 |
/* compile-time position */ |
78 |
||
79 |
def here: Here = |
|
80 |
{ |
|
81 |
val exn = new Exception |
|
82 |
exn.getStackTrace.toList match { |
|
83 |
case _ :: caller :: _ => |
|
84 |
val name = proper_string(caller.getFileName).getOrElse("") |
|
85 |
val line = caller.getLineNumber |
|
86 |
new Here(name, line) |
|
87 |
case _ => new Here("", 0) |
|
88 |
} |
|
89 |
} |
|
90 |
||
91 |
class Here private[Scala_Project](name: String, line: Int) |
|
92 |
{ |
|
93 |
override def toString: String = name + ":" + line |
|
94 |
def position: Position.T = |
|
72762 | 95 |
isabelle_scala_files.get(name) match { |
96 |
case Some(path) => Position.Line_File(line, path.implode) |
|
97 |
case None => Position.none |
|
72755 | 98 |
} |
99 |
} |
|
100 |
||
101 |
||
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
102 |
/* scala project */ |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
103 |
|
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
104 |
def package_dir(source_file: Path): Option[Path] = |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
105 |
{ |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
106 |
val is_java = source_file.file_name.endsWith(".java") |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
107 |
val lines = split_lines(File.read(source_file)) |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
108 |
val Package = """\s*\bpackage\b\s*(?:object\b\s*)?((?:\w|\.)+)\b.*""".r |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
109 |
lines.collectFirst( |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
110 |
{ |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
111 |
case Package(name) => |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
112 |
if (is_java) Path.explode(space_explode('.', name).mkString("/")) |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
113 |
else Path.basic(name) |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
114 |
}) |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
115 |
} |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
116 |
|
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
117 |
def the_package_dir(source_file: Path): Path = |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
118 |
package_dir(source_file) getOrElse error("Failed to guess package from " + source_file) |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
119 |
|
73340 | 120 |
def scala_project(project_dir: Path, symlinks: Boolean = false): Unit = |
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
121 |
{ |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
122 |
if (symlinks && Platform.is_windows) |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
123 |
error("Cannot create symlinks on Windows") |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
124 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
125 |
if (project_dir.is_file || project_dir.is_dir) |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
126 |
error("Project directory already exists: " + project_dir) |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
127 |
|
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
128 |
val java_src_dir = Isabelle_System.make_directory(project_dir + Path.explode("src/main/java")) |
72376 | 129 |
val scala_src_dir = Isabelle_System.make_directory(project_dir + Path.explode("src/main/scala")) |
71524
4b908e70d642
copy jEdit sources instead of jar, for better browsing experience;
wenzelm
parents:
71503
diff
changeset
|
130 |
|
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
131 |
val (jar_files, source_files) = isabelle_files |
72762 | 132 |
isabelle_scala_files |
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
133 |
|
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
134 |
for (source <- source_files) { |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
135 |
val dir = if (source.file_name.endsWith(".java")) java_src_dir else scala_src_dir |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
136 |
val target = dir + the_package_dir(source) |
72375 | 137 |
Isabelle_System.make_directory(target) |
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
138 |
if (symlinks) Isabelle_System.symlink(source, target) |
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
139 |
else Isabelle_System.copy_file(source, target) |
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
140 |
} |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
141 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
142 |
File.write(project_dir + Path.explode("settings.gradle"), "rootProject.name = 'Isabelle'\n") |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
143 |
File.write(project_dir + Path.explode("build.gradle"), |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
144 |
"""plugins { |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
145 |
id 'scala' |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
146 |
} |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
147 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
148 |
repositories { |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
149 |
mavenCentral() |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
150 |
} |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
151 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
152 |
dependencies { |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
153 |
implementation 'org.scala-lang:scala-library:""" + scala.util.Properties.versionNumberString + """' |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
154 |
compile files( |
74030
39e05601faeb
more accurate scala_project, based on build.props of components;
wenzelm
parents:
73987
diff
changeset
|
155 |
""" + jar_files.map(jar => groovy_string(File.platform_path(jar))).mkString("", ",\n ", ")") + |
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
156 |
""" |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
157 |
} |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
158 |
""") |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
159 |
} |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
160 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
161 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
162 |
/* Isabelle tool wrapper */ |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
163 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
164 |
val isabelle_tool = |
72763 | 165 |
Isabelle_Tool("scala_project", "setup Gradle project for Isabelle/Scala/jEdit", |
166 |
Scala_Project.here, args => |
|
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
167 |
{ |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
168 |
var symlinks = false |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
169 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
170 |
val getopts = Getopts(""" |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
171 |
Usage: isabelle scala_project [OPTIONS] PROJECT_DIR |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
172 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
173 |
Options are: |
71503 | 174 |
-L make symlinks to original scala files |
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
175 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
176 |
Setup Gradle project for Isabelle/Scala/jEdit --- to support Scala IDEs |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
177 |
such as IntelliJ IDEA. |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
178 |
""", |
71503 | 179 |
"L" -> (_ => symlinks = true)) |
71378
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
180 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
181 |
val more_args = getopts(args) |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
182 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
183 |
val project_dir = |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
184 |
more_args match { |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
185 |
case List(dir) => Path.explode(dir) |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
186 |
case _ => getopts.usage() |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
187 |
} |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
188 |
|
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
189 |
scala_project(project_dir, symlinks = symlinks) |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
190 |
}) |
820cf124dced
added "isabelle scala_project" to support e.g. IntelliJ IDEA;
wenzelm
parents:
diff
changeset
|
191 |
} |