Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
SquirrelJME
Commits
5963046f
Commit
5963046f
authored
Jul 18, 2021
by
Stephanie Gawroriski
Browse files
Move over manifest.
parent
11a7b90e
Changes
28
Hide whitespace changes
Inline
Side-by-side
.idea/compiler.xml
View file @
5963046f
...
...
@@ -76,6 +76,8 @@
<module
name=
"squirreljme.modules.tool-jdwp.main"
target=
"1.7"
/>
<module
name=
"squirreljme.modules.tool-jdwp.test"
target=
"1.7"
/>
<module
name=
"squirreljme.modules.tool-jdwp.testFixtures"
target=
"1.7"
/>
<module
name=
"squirreljme.modules.tool-manifest-reader.main"
target=
"1.7"
/>
<module
name=
"squirreljme.modules.tool-manifest-reader.test"
target=
"1.7"
/>
<module
name=
"squirreljme.modules.tool-manifest-reader.testFixtures"
target=
"1.7"
/>
<module
name=
"squirreljme.modules.tool-manifest-writer.testFixtures"
target=
"1.7"
/>
<module
name=
"squirreljme.modules.tool-packfile.testFixtures"
target=
"1.7"
/>
...
...
.idea/gradle.xml
View file @
5963046f
...
...
@@ -68,7 +68,6 @@
<option
value=
"$PROJECT_DIR$/modules/tac"
/>
<option
value=
"$PROJECT_DIR$/modules/tool-classfile"
/>
<option
value=
"$PROJECT_DIR$/modules/tool-jarfile"
/>
<option
value=
"$PROJECT_DIR$/modules/tool-manifest-reader"
/>
<option
value=
"$PROJECT_DIR$/modules/tool-manifest-writer"
/>
<option
value=
"$PROJECT_DIR$/modules/tool-packfile"
/>
<option
value=
"$PROJECT_DIR$/modules/vodafone-api"
/>
...
...
emulators/springcoat-vm/build.gradle
View file @
5963046f
...
...
@@ -15,7 +15,6 @@ dependencies
api
project
(
":modules:common-vm"
)
api
project
(
":modules:meep-swm"
)
api
project
(
":modules:tool-classfile"
)
api
project
(
":modules:tool-manifest-reader"
)
api
project
(
":modules:debug-jdwp"
)
}
...
...
modules/
tool-manifest-reader/src/main/java/net/multiphasicapps/tool
/manifest/JavaManifest.java
→
modules/
cldc-compact/src/main/java/cc/squirreljme/jvm
/manifest/JavaManifest.java
View file @
5963046f
...
...
@@ -8,7 +8,7 @@
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package
net.multiphasicapps.tool
.manifest
;
package
cc.squirreljme.jvm
.manifest
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
...
...
@@ -17,9 +17,9 @@ import java.io.InputStreamReader;
import
java.io.Reader
;
import
java.util.AbstractMap
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
java.util.Set
;
import
net.multiphasicapps.collections.UnmodifiableMap
;
/**
* This contains decoders for the standard Java manifest format.
...
...
@@ -31,28 +31,8 @@ import net.multiphasicapps.collections.UnmodifiableMap;
public
final
class
JavaManifest
extends
AbstractMap
<
String
,
JavaManifestAttributes
>
{
/** Read a key. */
private
static
final
int
_STAGE_KEY
=
0
;
/** Read a value (start). */
private
static
final
int
_STAGE_VALUE_START
=
1
;
/** Read a value (padding). */
private
static
final
int
_STAGE_VALUE_PADDING
=
2
;
/** Read a value (length). */
private
static
final
int
_STAGE_VALUE_LINE
=
3
;
/** Potentially may be a continuation of a line. */
private
static
final
int
_STAGE_VALUE_MIGHT_CONTINUE
=
4
;
/** The attributes defined in this manifest file. */
pr
otec
te
d
final
Map
<
String
,
JavaManifestAttributes
>
attributes
;
pr
iva
te
final
Map
<
String
,
JavaManifestAttributes
>
_
attributes
;
/**
* Initializes a blank manifest.
...
...
@@ -62,13 +42,11 @@ public final class JavaManifest
public
JavaManifest
()
{
// Initialize a blank set of main attributes
Map
<
String
,
JavaManifestAttributes
>
backing
=
new
HashMap
<>();
Map
<
String
,
JavaManifestAttributes
>
backing
=
new
HashMap
<>();
backing
.
put
(
""
,
new
JavaManifestAttributes
());
// Lock in the backing map
this
.
attributes
=
UnmodifiableMap
.<
String
,
JavaManifestAttributes
>
of
(
backing
);
this
.
_attributes
=
backing
;
}
/**
...
...
@@ -84,7 +62,8 @@ public final class JavaManifest
public
JavaManifest
(
InputStream
__is
)
throws
IOException
,
JavaManifestException
,
NullPointerException
{
this
(
new
BufferedReader
(
new
InputStreamReader
(
__is
,
"utf-8"
)));
this
(
new
BufferedReader
(
new
InputStreamReader
(
__is
,
"utf-8"
)));
}
/**
...
...
@@ -104,10 +83,10 @@ public final class JavaManifest
throw
new
NullPointerException
(
"NARG"
);
// The backing map and temporary key/value pairs for each
// att
i
ribute set
// attribute set
String
curname
=
""
;
Map
<
String
,
JavaManifestAttributes
>
backing
=
new
HashMap
<>();
Map
<
JavaManifestKey
,
String
>
working
=
new
HashMap
<>();
Map
<
String
,
JavaManifestAttributes
>
backing
=
new
Linked
HashMap
<>();
Map
<
JavaManifestKey
,
String
>
working
=
new
Linked
HashMap
<>();
// Read input file line by line, since it is more efficient than
// character by character
...
...
@@ -224,8 +203,7 @@ public final class JavaManifest
backing
.
put
(
curname
,
new
JavaManifestAttributes
(
working
));
// Lock in the backing map
this
.
attributes
=
UnmodifiableMap
.<
String
,
JavaManifestAttributes
>
of
(
backing
);
this
.
_attributes
=
backing
;
}
/**
...
...
@@ -235,7 +213,7 @@ public final class JavaManifest
@Override
public
boolean
containsKey
(
Object
__k
)
{
return
this
.
attributes
.
containsKey
(
__k
);
return
this
.
_
attributes
.
containsKey
(
__k
);
}
/**
...
...
@@ -245,7 +223,7 @@ public final class JavaManifest
@Override
public
Set
<
Map
.
Entry
<
String
,
JavaManifestAttributes
>>
entrySet
()
{
return
this
.
attributes
.
entrySet
();
return
this
.
_
attributes
.
entrySet
();
}
/**
...
...
@@ -255,7 +233,7 @@ public final class JavaManifest
@Override
public
JavaManifestAttributes
get
(
Object
__k
)
{
return
this
.
attributes
.
get
(
__k
);
return
this
.
_
attributes
.
get
(
__k
);
}
/**
...
...
@@ -266,7 +244,7 @@ public final class JavaManifest
*/
public
JavaManifestAttributes
getMainAttributes
()
{
return
this
.
attributes
.
get
(
""
);
return
this
.
_
attributes
.
get
(
""
);
}
/**
...
...
@@ -276,7 +254,7 @@ public final class JavaManifest
@Override
public
int
size
()
{
return
this
.
attributes
.
size
();
return
this
.
_
attributes
.
size
();
}
/**
...
...
@@ -306,18 +284,5 @@ public final class JavaManifest
{
return
JavaManifest
.
__isAlphaNum
(
__c
)
||
__c
==
'_'
||
__c
==
'-'
;
}
/**
* Returns {@code true} if the character is specified to be a newline
* character.
*
* @param __c The character to check.
* @return {@code true} if the character specifies the next line.
* @since 2016/05/29
*/
private
static
boolean
__isNewline
(
char
__c
)
{
return
__c
==
'\r'
||
__c
==
'\n'
;
}
}
modules/
tool-manifest-reader/src/main/java/net/multiphasicapps/tool
/manifest/JavaManifestAttributes.java
→
modules/
cldc-compact/src/main/java/cc/squirreljme/jvm
/manifest/JavaManifestAttributes.java
View file @
5963046f
...
...
@@ -8,14 +8,13 @@
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package
net.multiphasicapps.tool
.manifest
;
package
cc.squirreljme.jvm
.manifest
;
import
java.util.AbstractMap
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
java.util.Set
;
import
net.multiphasicapps.collections.EmptyMap
;
import
net.multiphasicapps.collections.UnmodifiableMap
;
/**
* This contains the attributes for a single section within the manifest file.
...
...
@@ -28,7 +27,7 @@ public final class JavaManifestAttributes
extends
AbstractMap
<
JavaManifestKey
,
String
>
{
/** The key value pairs. */
pr
otec
te
d
final
Map
<
JavaManifestKey
,
String
>
pairs
;
pr
iva
te
final
Map
<
JavaManifestKey
,
String
>
_
pairs
;
/**
* Initializes empty manifest attributes.
...
...
@@ -37,7 +36,7 @@ public final class JavaManifestAttributes
*/
JavaManifestAttributes
()
{
this
.
pairs
=
EmptyMap
.<
JavaManifestKey
,
String
>
empty
();
this
.
_
pairs
=
new
HashMap
<>
();
}
/**
...
...
@@ -55,8 +54,7 @@ public final class JavaManifestAttributes
throw
new
NullPointerException
(
"NARG"
);
// Copy
this
.
pairs
=
UnmodifiableMap
.<
JavaManifestKey
,
String
>
of
(
new
HashMap
<>(
__from
));
this
.
_pairs
=
new
LinkedHashMap
<>(
__from
);
}
/**
...
...
@@ -66,7 +64,7 @@ public final class JavaManifestAttributes
@Override
public
boolean
containsKey
(
Object
__o
)
{
return
this
.
pairs
.
containsKey
(
__o
);
return
this
.
_
pairs
.
containsKey
(
__o
);
}
/**
...
...
@@ -100,7 +98,7 @@ public final class JavaManifestAttributes
@Override
public
Set
<
Map
.
Entry
<
JavaManifestKey
,
String
>>
entrySet
()
{
return
this
.
pairs
.
entrySet
();
return
this
.
_
pairs
.
entrySet
();
}
/**
...
...
@@ -110,7 +108,7 @@ public final class JavaManifestAttributes
@Override
public
String
get
(
Object
__o
)
{
return
this
.
pairs
.
get
(
__o
);
return
this
.
_
pairs
.
get
(
__o
);
}
/**
...
...
@@ -199,7 +197,7 @@ public final class JavaManifestAttributes
@Override
public
int
size
()
{
return
this
.
pairs
.
size
();
return
this
.
_
pairs
.
size
();
}
}
modules/
tool-manifest-reader/src/main/java/net/multiphasicapps/tool
/manifest/JavaManifestException.java
→
modules/
cldc-compact/src/main/java/cc/squirreljme/jvm
/manifest/JavaManifestException.java
View file @
5963046f
...
...
@@ -8,7 +8,7 @@
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package
net.multiphasicapps.tool
.manifest
;
package
cc.squirreljme.jvm
.manifest
;
/**
* This is thrown when the manifest is not valid.
...
...
modules/
tool-manifest-reader/src/main/java/net/multiphasicapps/tool
/manifest/JavaManifestKey.java
→
modules/
cldc-compact/src/main/java/cc/squirreljme/jvm
/manifest/JavaManifestKey.java
View file @
5963046f
...
...
@@ -8,7 +8,7 @@
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package
net.multiphasicapps.tool
.manifest
;
package
cc.squirreljme.jvm
.manifest
;
/**
* This represents a key which is used in a manifest, it is case insensitive
...
...
modules/
tool-manifest-reader/src/main/java/net/multiphasicapps/tool
/manifest/package-info.java
→
modules/
cldc-compact/src/main/java/cc/squirreljme/jvm
/manifest/package-info.java
View file @
5963046f
...
...
@@ -14,5 +14,5 @@
* @since 2016/05/20
*/
package
net.multiphasicapps.tool
.manifest
;
package
cc.squirreljme.jvm
.manifest
;
modules/common-vm/build.gradle
View file @
5963046f
...
...
@@ -21,6 +21,5 @@ dependencies
api
project
(
":modules:midp-lcdui"
)
api
project
(
":modules:meep-swm"
)
api
project
(
":modules:meep-midlet"
)
api
project
(
":modules:tool-manifest-reader"
)
api
project
(
":modules:zip"
)
}
modules/launcher/build.gradle
View file @
5963046f
...
...
@@ -26,5 +26,4 @@ dependencies
api
project
(
":modules:midp-lcdui"
)
api
project
(
":modules:meep-midlet"
)
api
project
(
":modules:meep-swm"
)
api
project
(
":modules:tool-manifest-reader"
)
}
modules/launcher/src/main/java/cc/squirreljme/runtime/launcher/ui/__Program__.java
View file @
5963046f
...
...
@@ -17,7 +17,7 @@ import cc.squirreljme.runtime.swm.EntryPoint;
import
java.io.IOException
;
import
java.io.InputStream
;
import
javax.microedition.lcdui.Image
;
import
net.multiphasicapps.tool
.manifest.JavaManifest
;
import
cc.squirreljme.jvm
.manifest.JavaManifest
;
/**
* Stores the program information which is mapped to what is displayed.
...
...
modules/meep-midlet/build.gradle
View file @
5963046f
...
...
@@ -20,7 +20,6 @@ dependencies
{
api
project
(
":modules:cldc-compact"
)
api
project
(
":modules:tool-manifest-reader"
)
api
project
(
":modules:strings"
)
api
project
(
":modules:collections"
)
}
modules/meep-midlet/src/main/java/javax/microedition/midlet/MIDlet.java
View file @
5963046f
...
...
@@ -18,8 +18,8 @@ import java.io.IOException;
import
java.io.InputStream
;
import
java.lang.ref.Reference
;
import
java.lang.ref.WeakReference
;
import
net.multiphasicapps.tool
.manifest.JavaManifest
;
import
net.multiphasicapps.tool
.manifest.JavaManifestKey
;
import
cc.squirreljme.jvm
.manifest.JavaManifest
;
import
cc.squirreljme.jvm
.manifest.JavaManifestKey
;
public
abstract
class
MIDlet
{
...
...
modules/meep-swm/build.gradle
View file @
5963046f
...
...
@@ -25,5 +25,4 @@ dependencies
api
project
(
":modules:collections"
)
api
project
(
":modules:meep-midlet"
)
api
project
(
":modules:strings"
)
api
project
(
":modules:tool-manifest-reader"
)
}
modules/meep-swm/src/main/java/cc/squirreljme/runtime/swm/DependencyInfo.java
View file @
5963046f
...
...
@@ -20,7 +20,7 @@ import java.util.Set;
import
net.multiphasicapps.collections.EmptySet
;
import
net.multiphasicapps.collections.UnmodifiableSet
;
import
net.multiphasicapps.strings.StringUtils
;
import
net.multiphasicapps.tool
.manifest.JavaManifestAttributes
;
import
cc.squirreljme.jvm
.manifest.JavaManifestAttributes
;
/**
* This contains the information which specifies all of the dependencies which
...
...
modules/meep-swm/src/main/java/cc/squirreljme/runtime/swm/EntryPoints.java
View file @
5963046f
...
...
@@ -13,9 +13,9 @@ package cc.squirreljme.runtime.swm;
import
java.util.AbstractList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
net.multiphasicapps.tool
.manifest.JavaManifest
;
import
net.multiphasicapps.tool
.manifest.JavaManifestAttributes
;
import
net.multiphasicapps.tool
.manifest.JavaManifestKey
;
import
cc.squirreljme.jvm
.manifest.JavaManifest
;
import
cc.squirreljme.jvm
.manifest.JavaManifestAttributes
;
import
cc.squirreljme.jvm
.manifest.JavaManifestKey
;
/**
* This parses the entry points which are available for usage.
...
...
modules/meep-swm/src/main/java/cc/squirreljme/runtime/swm/ProvidedInfo.java
View file @
5963046f
...
...
@@ -19,7 +19,7 @@ import java.util.Set;
import
net.multiphasicapps.collections.EmptySet
;
import
net.multiphasicapps.collections.UnmodifiableSet
;
import
net.multiphasicapps.strings.StringUtils
;
import
net.multiphasicapps.tool
.manifest.JavaManifestAttributes
;
import
cc.squirreljme.jvm
.manifest.JavaManifestAttributes
;
/**
* This contains all of the information for dependencies which are provided
...
...
modules/meep-swm/src/main/java/cc/squirreljme/runtime/swm/SuiteInfo.java
View file @
5963046f
...
...
@@ -13,8 +13,8 @@ package cc.squirreljme.runtime.swm;
import
java.lang.ref.Reference
;
import
java.lang.ref.WeakReference
;
import
java.util.Objects
;
import
net.multiphasicapps.tool
.manifest.JavaManifest
;
import
net.multiphasicapps.tool
.manifest.JavaManifestAttributes
;
import
cc.squirreljme.jvm
.manifest.JavaManifest
;
import
cc.squirreljme.jvm
.manifest.JavaManifestAttributes
;
/**
* This contains all of the information which is provided by a suite.
...
...
modules/meep-swm/src/main/java/cc/squirreljme/runtime/swm/SuiteType.java
View file @
5963046f
...
...
@@ -12,9 +12,9 @@ package cc.squirreljme.runtime.swm;
import
java.lang.ref.Reference
;
import
java.lang.ref.WeakReference
;
import
net.multiphasicapps.tool
.manifest.JavaManifest
;
import
net.multiphasicapps.tool
.manifest.JavaManifestAttributes
;
import
net.multiphasicapps.tool
.manifest.JavaManifestKey
;
import
cc.squirreljme.jvm
.manifest.JavaManifest
;
import
cc.squirreljme.jvm
.manifest.JavaManifestAttributes
;
import
cc.squirreljme.jvm
.manifest.JavaManifestKey
;
/**
* This represents the type of suite that a suite may be.
...
...
modules/meep-swm/src/main/java/cc/squirreljme/runtime/swm/launch/SuiteScanner.java
View file @
5963046f
...
...
@@ -26,7 +26,7 @@ import java.util.LinkedHashMap;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
net.multiphasicapps.tool
.manifest.JavaManifest
;
import
cc.squirreljme.jvm
.manifest.JavaManifest
;
/**
* This is a scanner which can read all of the application groups that are
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment