Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vdt-plugin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
vdt-plugin
Commits
83666e1b
Commit
83666e1b
authored
Apr 01, 2014
by
Paulo Henrique Silva
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1 from phsilva/add-osx-detection
Add support for OS X detection.
parents
1f6c2179
9c87838d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
18 deletions
+31
-18
Utils.java
src/com/elphel/vdt/core/Utils.java
+23
-14
OSNameGenerator.java
...com/elphel/vdt/core/tools/generators/OSNameGenerator.java
+7
-4
Installation.xml
tools/Installation.xml
+1
-0
No files found.
src/com/elphel/vdt/core/Utils.java
View file @
83666e1b
...
@@ -26,16 +26,17 @@
...
@@ -26,16 +26,17 @@
*******************************************************************************/
*******************************************************************************/
package
com
.
elphel
.
vdt
.
core
;
package
com
.
elphel
.
vdt
.
core
;
import
java.util.*
;
import
java.util.Iterator
;
import
java.util.List
;
import
org.eclipse.core.resources.IProject
;
import
org.eclipse.core.resources.IProjectDescription
;
import
org.eclipse.core.resources.IProject
;
import
org.eclipse.core.runtime.CoreException
;
import
org.eclipse.core.resources.IProjectDescription
;
import
org.eclipse.core.runtime.IProgressMonitor
;
import
org.eclipse.core.runtime.CoreException
;
import
org.eclipse.core.runtime.NullProgressMonitor
;
import
org.eclipse.core.runtime.IProgressMonitor
;
import
org.eclipse.core.runtime.OperationCanceledException
;
import
org.eclipse.core.runtime.NullProgressMonitor
;
import
org.eclipse.core.runtime.OperationCanceledException
;
import
com.elphel.vdt.ui.MessageUI
;
import
com.elphel.vdt.ui.MessageUI
;
/**
/**
* Utilities for VDT Plud-in.
* Utilities for VDT Plud-in.
...
@@ -47,7 +48,9 @@ import com.elphel.vdt.ui.MessageUI;
...
@@ -47,7 +48,9 @@ import com.elphel.vdt.ui.MessageUI;
public
class
Utils
{
public
class
Utils
{
public
static
final
int
OS_WINDOWS
=
1
;
public
static
final
int
OS_WINDOWS
=
1
;
public
static
final
int
OS_LINUX
=
2
;
public
static
final
int
OS_LINUX
=
2
;
public
static
final
int
OS_MAC
=
3
;
private
static
int
os
;
private
static
int
os
;
public
static
boolean
isWindows
()
{
public
static
boolean
isWindows
()
{
...
@@ -56,8 +59,12 @@ public class Utils {
...
@@ -56,8 +59,12 @@ public class Utils {
public
static
boolean
isLinux
()
{
public
static
boolean
isLinux
()
{
return
os
==
OS_LINUX
;
return
os
==
OS_LINUX
;
}
}
public
static
boolean
isMac
()
{
return
os
==
OS_MAC
;
}
/** Returns the pure file name without path and extensions. */
/** Returns the pure file name without path and extensions. */
public
static
String
getPureFileName
(
String
fileName
)
{
public
static
String
getPureFileName
(
String
fileName
)
{
if
((
fileName
==
null
)
||
(
fileName
.
length
()
==
0
))
if
((
fileName
==
null
)
||
(
fileName
.
length
()
==
0
))
...
@@ -138,7 +145,9 @@ public class Utils {
...
@@ -138,7 +145,9 @@ public class Utils {
if
(
osName
.
indexOf
(
"Windows"
)
>=
0
)
if
(
osName
.
indexOf
(
"Windows"
)
>=
0
)
os
=
OS_WINDOWS
;
os
=
OS_WINDOWS
;
else
if
(
osName
.
indexOf
(
"Linux"
)
>=
0
)
else
if
(
osName
.
indexOf
(
"Linux"
)
>=
0
)
os
=
OS_LINUX
;
os
=
OS_LINUX
;
else
if
(
osName
.
contains
(
"OS X"
))
os
=
OS_MAC
;
else
else
MessageUI
.
fatalError
(
"Unknown os.name"
);
MessageUI
.
fatalError
(
"Unknown os.name"
);
}
}
...
...
src/com/elphel/vdt/core/tools/generators/OSNameGenerator.java
View file @
83666e1b
...
@@ -26,15 +26,16 @@
...
@@ -26,15 +26,16 @@
*******************************************************************************/
*******************************************************************************/
package
com
.
elphel
.
vdt
.
core
.
tools
.
generators
;
package
com
.
elphel
.
vdt
.
core
.
tools
.
generators
;
import
com.elphel.vdt.VDT
;
import
com.elphel.vdt.VDT
;
import
com.elphel.vdt.ui.MessageUI
;
import
com.elphel.vdt.ui.MessageUI
;
public
class
OSNameGenerator
extends
AbstractGenerator
{
public
class
OSNameGenerator
extends
AbstractGenerator
{
public
static
final
String
NAME
=
VDT
.
GENERATOR_ID_OS_NAME
;
public
static
final
String
NAME
=
VDT
.
GENERATOR_ID_OS_NAME
;
private
static
final
String
OS_WINDOWS
=
"Windows"
;
private
static
final
String
OS_WINDOWS
=
"Windows"
;
private
static
final
String
OS_LINUX
=
"Linux"
;
private
static
final
String
OS_LINUX
=
"Linux"
;
private
static
final
String
OS_MAC
=
"Mac OS X"
;
public
String
getName
()
{
public
String
getName
()
{
return
NAME
;
return
NAME
;
...
@@ -50,7 +51,9 @@ public class OSNameGenerator extends AbstractGenerator {
...
@@ -50,7 +51,9 @@ public class OSNameGenerator extends AbstractGenerator {
if
(
osName
.
indexOf
(
OS_WINDOWS
)
>=
0
)
{
if
(
osName
.
indexOf
(
OS_WINDOWS
)
>=
0
)
{
return
new
String
[]
{
OS_WINDOWS
};
return
new
String
[]
{
OS_WINDOWS
};
}
else
if
(
osName
.
indexOf
(
"Linux"
)
>=
0
)
{
}
else
if
(
osName
.
indexOf
(
"Linux"
)
>=
0
)
{
return
new
String
[]
{
OS_LINUX
};
return
new
String
[]
{
OS_LINUX
};
}
else
if
(
osName
.
contains
(
"OS X"
))
{
return
new
String
[]
{
OS_MAC
};
}
else
{
}
else
{
MessageUI
.
error
(
"Generator '"
+
getName
()
+
"' failure: OS '"
+
osName
+
"' is unknown"
);
MessageUI
.
error
(
"Generator '"
+
getName
()
+
"' failure: OS '"
+
osName
+
"' is unknown"
);
return
null
;
return
null
;
...
...
tools/Installation.xml
View file @
83666e1b
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
<paramtype
kind=
"enum"
base=
"String"
>
<paramtype
kind=
"enum"
base=
"String"
>
<item
value=
"Windows"
/>
<item
value=
"Windows"
/>
<item
value=
"Linux"
/>
<item
value=
"Linux"
/>
<item
value=
"Mac OS X"
/>
</paramtype>
</paramtype>
</typedef>
</typedef>
...
...
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