Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
e1cb3475
Commit
e1cb3475
authored
Dec 14, 2011
by
Hal Abelson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding build id to status panel. Still needs to be finished.
parent
2171c813
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
53 additions
and
31 deletions
+53
-31
appinventor/appengine/build.xml
appinventor/appengine/build.xml
+9
-1
appinventor/appengine/src/com/google/appinventor/client/Ode.java
...ntor/appengine/src/com/google/appinventor/client/Ode.java
+9
-14
appinventor/appengine/src/com/google/appinventor/client/StatusPanel.java
...engine/src/com/google/appinventor/client/StatusPanel.java
+10
-8
appinventor/appengine/src/com/google/appinventor/server/HelpServiceImpl.java
...ne/src/com/google/appinventor/server/HelpServiceImpl.java
+5
-3
appinventor/appengine/src/com/google/appinventor/server/util/BuildData.java
...ine/src/com/google/appinventor/server/util/BuildData.java
+9
-0
appinventor/appengine/src/com/google/appinventor/shared/rpc/help/HelpService.java
...c/com/google/appinventor/shared/rpc/help/HelpService.java
+3
-3
appinventor/appengine/src/com/google/appinventor/shared/rpc/help/HelpServiceAsync.java
.../google/appinventor/shared/rpc/help/HelpServiceAsync.java
+2
-2
appinventor/appengine/war/WEB-INF/appengine-web.xml
appinventor/appengine/war/WEB-INF/appengine-web.xml
+6
-0
No files found.
appinventor/appengine/build.xml
View file @
e1cb3475
...
...
@@ -45,14 +45,22 @@
description=
"Create and populate build/war directory structure"
depends=
"init"
>
<mkdir
dir=
"${build.war.dir}"
/>
<exec
executable=
"hg"
outputproperty=
"mercurial.version.id"
>
<arg
line =
"id -n -i "
/>
</exec>
<filter
token=
"mercurial.version.id"
value=
"${mercurial.version.id}"
/>
<copy
todir=
"${build.war.dir}/WEB-INF/"
file=
"war/WEB-INF/appengine-web.xml"
filtering=
"true"
/>
<copy
todir=
"${build.war.dir}/"
>
<fileset
dir=
"war"
/>
<fileset
dir=
"war"
>
<exclude
name=
"WEB-INF/appengine-web.xml"
/>
</fileset>
<fileset
dir=
"src/${appinventor.pkg}"
>
<!-- canvas is a special case (see MockCanvas.java) -->
<include
name=
"images/canvas.png"
/>
</fileset>
<fileset
dir=
"${docs.dir}"
/>
</copy>
</target>
<!-- =====================================================================
...
...
appinventor/appengine/src/com/google/appinventor/client/Ode.java
View file @
e1cb3475
...
...
@@ -103,10 +103,6 @@ public class Ode implements EntryPoint {
// User information
private
User
user
;
// Timestamp of the build, supplied by the BuildData class
// Warning: This is available only when running the deploy jar
private
String
buildTimeStamp
;
// Collection of projects
private
ProjectManager
projectManager
;
...
...
@@ -443,28 +439,27 @@ public class Ode implements EntryPoint {
/*
* If the server is running in production in Young Android mode,
* this gets the build
timestamp, initializes the field buildTimeStamp
,
* this gets the build
id, initializes the field mercurialBuildId
,
* and adds it to the StatusPanel. Otherwise, it has no effect.
****
*/
private
void
getBuildInfo
()
{
OdeAsyncCallback
<
String
>
buildTimeStampCallback
=
// Id of the build, supplied by the BuildData class
OdeAsyncCallback
<
String
>
mercurialBuildIdCallback
=
new
OdeAsyncCallback
<
String
>(
MESSAGES
.
serverUnavailable
())
{
@Override
public
void
onSuccess
(
String
result
)
{
buildTimeStamp
=
result
;
onBuildInfoLoaded
();
}
private
void
onBuildInfoLoaded
()
{
StatusPanel
.
showBuildTimeStamp
(
buildTimeStamp
);
String
mercurialBuildId
=
result
;
StatusPanel
.
showMercurialBuildId
(
mercurialBuildId
);
}
};
// TODO(halabelson): see the TODO(forster) above:
// Getting the build
timestamp
adds another RPC call.
// Getting the build
id
adds another RPC call.
getHelpService
().
get
BuildTimeStamp
(
buildTimeStamp
Callback
);
getHelpService
().
get
MercurialBuildId
(
mercurialBuildId
Callback
);
}
/*
...
...
appinventor/appengine/src/com/google/appinventor/client/StatusPanel.java
View file @
e1cb3475
...
...
@@ -15,12 +15,14 @@ import com.google.gwt.user.client.ui.Label;
*
*/
public
class
StatusPanel
extends
Composite
{
private
static
Label
buildTimeStamp
=
new
Label
();
// Note that timestamp will be the real timestamp only
// when running the deploy jar.
public
static
void
showBuildTimeStamp
(
String
timestamp
)
{
buildTimeStamp
.
setText
(
"Build: "
+
timestamp
);
private
static
Label
buildId
=
new
Label
();
// This shows the id from mercurial hg id -n -i
public
static
void
showMercurialBuildId
(
String
id
)
{
String
[]
idAndVersion
=
id
.
split
(
"\\s+"
);
if
(
idAndVersion
.
length
==
2
)
{
buildId
.
setText
(
"Version: "
+
idAndVersion
[
1
]
+
" Id: "
+
idAndVersion
[
0
]);
}
}
private
String
AppInventorFooter
=
...
...
@@ -40,8 +42,8 @@ public class StatusPanel extends Composite {
hpanel
.
setWidth
(
"100%"
);
hpanel
.
setHorizontalAlignment
(
HorizontalPanel
.
ALIGN_LEFT
);
hpanel
.
add
(
new
HTML
(
AppInventorFooter
));
hpanel
.
add
(
build
TimeStamp
);
hpanel
.
setCellHorizontalAlignment
(
build
TimeStamp
,
HorizontalPanel
.
ALIGN_RIGHT
);
hpanel
.
add
(
build
Id
);
hpanel
.
setCellHorizontalAlignment
(
build
Id
,
HorizontalPanel
.
ALIGN_RIGHT
);
initWidget
(
hpanel
);
setStyleName
(
"ode-StatusPanel"
);
...
...
appinventor/appengine/src/com/google/appinventor/server/HelpServiceImpl.java
View file @
e1cb3475
...
...
@@ -2,6 +2,7 @@
package
com.google.appinventor.server
;
import
com.google.appinventor.server.util.BuildData
;
import
com.google.appinventor.shared.rpc.help.HelpService
;
...
...
@@ -21,9 +22,10 @@ public class HelpServiceImpl extends OdeRemoteServiceServlet implements HelpServ
private
static
final
Logger
LOG
=
Logger
.
getLogger
(
HelpServiceImpl
.
class
.
getName
());
/*
* Provide the
server deploy timestamp
* Provide the
Mercurial Id from "hg id -i -n"
*/
public
String
get
BuildTimeStamp
()
{
return
BuildData
.
get
TimestampAsString
();
public
String
get
MercurialBuildId
()
{
return
BuildData
.
get
MercurialId
();
}
}
appinventor/appengine/src/com/google/appinventor/server/util/BuildData.java
View file @
e1cb3475
...
...
@@ -4,6 +4,9 @@ package com.google.appinventor.server.util;
import
com.google.appengine.api.utils.SystemProperty
;
import
com.google.appinventor.server.flags.Flag
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
...
...
@@ -17,6 +20,7 @@ public class BuildData {
private
static
long
timestamp
=
0
;
private
static
Date
date
=
null
;
private
static
final
Flag
<
String
>
mercurialBuildId
=
Flag
.
createFlag
(
"mercurialBuildId"
,
""
);
/**
* Returns the timestamp for when the app was deployed (as a Unix time,
...
...
@@ -56,4 +60,9 @@ public class BuildData {
}
return
""
;
}
// Get the id supplied by hg -n -i
public
static
String
getMercurialId
()
{
return
mercurialBuildId
.
get
();
}
}
appinventor/appengine/src/com/google/appinventor/shared/rpc/help/HelpService.java
View file @
e1cb3475
...
...
@@ -14,8 +14,8 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
public
interface
HelpService
extends
RemoteService
{
/**
* Returns the
Build TimeStamp, or a message indicating that it could not be provided.
* @return
build time stamp
* Returns the
Mercurial Id generated by "hg -i -n"
* @return
mercurial build id
*/
String
get
BuildTimeStamp
();
String
get
MercurialBuildId
();
}
appinventor/appengine/src/com/google/appinventor/shared/rpc/help/HelpServiceAsync.java
View file @
e1cb3475
...
...
@@ -13,7 +13,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
public
interface
HelpServiceAsync
{
/**
* @see HelpService#get
BuildTimeStamp
()
* @see HelpService#get
MercurialId
()
*/
void
get
BuildTimeStamp
(
AsyncCallback
<
String
>
callback
);
void
get
MercurialBuildId
(
AsyncCallback
<
String
>
callback
);
}
appinventor/appengine/war/WEB-INF/appengine-web.xml
View file @
e1cb3475
...
...
@@ -46,8 +46,14 @@
resource expensive on App Engine -->
<property
name=
"motd.check.interval.secs"
value=
"0"
/>
<!-- ant will replace the pattern with the result of "hg -n -i" -->
<property
name=
"mercurialBuildId"
value=
"@mercurial.version.id@"
/>
</system-properties>
<!-- Enable concurrency in the app engine server -->
<threadsafe>
true
</threadsafe>
</appengine-web-app>
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