Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
webapp-lib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CS-214
ul2024
webapp-lib
Commits
62336ffe
Commit
62336ffe
authored
1 month ago
by
François Henri Théron
Browse files
Options
Downloads
Patches
Plain Diff
feat: removing reflexion
parent
6d5ff0ff
Branches
Branches containing commit
No related tags found
1 merge request
!42
Removing Reflexion
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build.sbt
+2
-2
2 additions, 2 deletions
build.sbt
jvm/src/main/scala/cs214/webapp/server/utils/AppsLoader.scala
+9
-16
9 additions, 16 deletions
...src/main/scala/cs214/webapp/server/utils/AppsLoader.scala
with
11 additions
and
18 deletions
build.sbt
+
2
−
2
View file @
62336ffe
...
@@ -5,7 +5,7 @@ val toolkitVersion = "0.6.0"
...
@@ -5,7 +5,7 @@ val toolkitVersion = "0.6.0"
val
webSocketVersion
=
"1.5.4"
val
webSocketVersion
=
"1.5.4"
val
caskVersion
=
"0.9.4"
val
caskVersion
=
"0.9.4"
val
slf4jVersion
=
"2.0.5"
val
slf4jVersion
=
"2.0.5"
val
reflectionsVersion
=
"0.10.2"
//
val reflectionsVersion = "0.10.2"
val
options
=
List
(
"-deprecation"
,
"-feature"
,
"-language:fewerBraces"
,
"-Xfatal-warnings"
)
val
options
=
List
(
"-deprecation"
,
"-feature"
,
"-language:fewerBraces"
,
"-Xfatal-warnings"
)
...
@@ -27,7 +27,7 @@ lazy val webappLib = crossProject(JSPlatform, JVMPlatform).in(file("."))
...
@@ -27,7 +27,7 @@ lazy val webappLib = crossProject(JSPlatform, JVMPlatform).in(file("."))
libraryDependencies
++=
Seq
(
libraryDependencies
++=
Seq
(
"com.lihaoyi"
%%
"cask"
%
caskVersion
,
"com.lihaoyi"
%%
"cask"
%
caskVersion
,
"org.slf4j"
%
"slf4j-nop"
%
slf4jVersion
,
"org.slf4j"
%
"slf4j-nop"
%
slf4jVersion
,
"org.reflections"
%
"reflections"
%
reflectionsVersion
,
//
"org.reflections" % "reflections" % reflectionsVersion,
"org.scala-lang"
%%
"toolkit-test"
%
toolkitVersion
%
Test
,
"org.scala-lang"
%%
"toolkit-test"
%
toolkitVersion
%
Test
,
),
),
)
)
This diff is collapsed.
Click to expand it.
jvm/src/main/scala/cs214/webapp/server/utils/AppsLoader.scala
+
9
−
16
View file @
62336ffe
package
cs214.webapp.server
package
cs214.webapp.server
package
utils
package
utils
import
java.lang.reflect.Modifier
import
scala.jdk.CollectionConverters.
*
import
org.reflections.Reflections
/** Finds all apps under the `apps` package. A class extending `StateMachine` is
/** Finds all apps under the `apps` package. A class extending `StateMachine` is * considered to be an app. */
* considered to be an app.
object
AppsLoader
:
*/
object
AppsLoader
:
private
val
APPS_PACKAGE
=
"apps"
private
val
APPS_PACKAGE
=
"apps"
def
loadApps
()
:
List
[
Class
[
?
]]
=
// List that should be overwritten by a real StateMachine list !
val
reflections
=
new
Reflections
(
APPS_PACKAGE
)
var
defaultClasses
:
List
[
Class
[
?
]]
=
List
.
empty
reflections
.
getSubTypesOf
(
classOf
[
StateMachine
[
?
,
?
,
?
]])
def
loadApps
()
:
List
[
Class
[
?
]]
=
defaultClasses
.
asScala
\ No newline at end of file
.
toList
.
filterNot
(
cls
=>
Modifier
.
isAbstract
(
cls
.
getModifiers
)
||
cls
.
isInterface
())
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment