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