@@ -3,13 +3,16 @@ import chrome.permissions.Permission
3
3
import chrome .permissions .Permission .{API , Host }
4
4
import com .alexitc .{Chrome , ChromeSbtPlugin }
5
5
6
- lazy val examples = project.in(file(" ." )).aggregate(exampleApp, extension)
6
+ lazy val scalajsChromeV = scala.io.Source
7
+ .fromInputStream(getClass.getClassLoader.getResourceAsStream(" /version.txt" ))
8
+ .getLines()
9
+ .toList
10
+ .head
7
11
8
- lazy val scalaJsChrome = ProjectRef (file(" ../. " ), " bindings " )
12
+ lazy val examples = project.in (file(" ." )).aggregate(exampleApp, extension )
9
13
10
14
lazy val exampleApp = project
11
15
.in(file(" app" ))
12
- .dependsOn(scalaJsChrome)
13
16
.enablePlugins(ChromeSbtPlugin )
14
17
.settings(
15
18
name := " Example App" ,
@@ -23,12 +26,12 @@ lazy val exampleApp = project
23
26
" -Xfatal-warnings" ,
24
27
" -feature"
25
28
),
29
+ libraryDependencies += " com.alexitc" %%% " scala-js-chrome" % scalajsChromeV,
26
30
scalaJSUseMainModuleInitializer := true ,
27
31
Test / scalaJSUseMainModuleInitializer := false ,
28
32
scalaJSLinkerConfig := scalaJSLinkerConfig.value.withRelativizeSourceMapBase(
29
33
Some ((Compile / fastOptJS / artifactPath).value.toURI)
30
34
),
31
- packageJSDependencies / skip := false ,
32
35
// you can customize and have a static output name for lib and dependencies
33
36
// instead of having the default files names like app-fastopt.js, ...
34
37
(Compile / fastOptJS / artifactPath) := {
@@ -37,19 +40,13 @@ lazy val exampleApp = project
37
40
(Compile / fullOptJS / artifactPath) := {
38
41
(fullOptJS / crossTarget).value / " main.js"
39
42
},
40
- (Compile / packageJSDependencies / artifactPath) := {
41
- (packageJSDependencies / crossTarget).value / " dependencies.js"
42
- },
43
- (Compile / packageMinifiedJSDependencies / artifactPath) := {
44
- (packageMinifiedJSDependencies / crossTarget).value / " dependencies.js"
45
- },
46
43
chromeManifest := new AppManifest {
47
44
val name = Keys .name.value
48
45
val version = Keys .version.value
49
46
50
47
val app = App (
51
48
background = Background (
52
- scripts = List (" main.js" , " dependencies .js" )
49
+ scripts = List (" main.js" , " main-bundle .js" )
53
50
)
54
51
)
55
52
override val defaultLocale = Some (" en" )
@@ -72,7 +69,6 @@ lazy val exampleApp = project
72
69
73
70
lazy val extension = project
74
71
.in(file(" extension" ))
75
- .dependsOn(scalaJsChrome)
76
72
.enablePlugins(ChromeSbtPlugin )
77
73
.settings(
78
74
name := " Example Extension" ,
@@ -86,12 +82,12 @@ lazy val extension = project
86
82
" -Xfatal-warnings" ,
87
83
" -feature"
88
84
),
85
+ libraryDependencies += " com.alexitc" %%% " scala-js-chrome" % scalajsChromeV,
89
86
scalaJSUseMainModuleInitializer := true ,
90
87
Test / scalaJSUseMainModuleInitializer := false ,
91
88
scalaJSLinkerConfig := scalaJSLinkerConfig.value.withRelativizeSourceMapBase(
92
89
Some ((Compile / fastOptJS / artifactPath).value.toURI)
93
90
),
94
- packageJSDependencies / skip := false ,
95
91
// you can customize and have a static output name for lib and dependencies
96
92
// instead of having the default files names like extension-fastopt.js, ...
97
93
(Compile / fastOptJS / artifactPath) := {
@@ -100,16 +96,10 @@ lazy val extension = project
100
96
(Compile / fullOptJS / artifactPath) := {
101
97
(fullOptJS / crossTarget).value / " main.js"
102
98
},
103
- (Compile / packageJSDependencies / artifactPath) := {
104
- (packageJSDependencies / crossTarget).value / " dependencies.js"
105
- },
106
- (Compile / packageMinifiedJSDependencies / artifactPath) := {
107
- (packageMinifiedJSDependencies / crossTarget).value / " dependencies.js"
108
- },
109
99
chromeManifest := new ExtensionManifest {
110
100
111
101
val background = Background (
112
- scripts = List (" main.js" , " dependencies .js" )
102
+ scripts = List (" main.js" , " main-bundle .js" )
113
103
)
114
104
val name = Keys .name.value
115
105
val version = Keys .version.value
0 commit comments