Thread: [Assorted-commits] SF.net SVN: assorted: [477] simple-build/trunk
Brought to you by:
yangzhang
|
From: <yan...@us...> - 2008-02-22 19:25:30
|
Revision: 477
http://assorted.svn.sourceforge.net/assorted/?rev=477&view=rev
Author: yangzhang
Date: 2008-02-22 11:25:34 -0800 (Fri, 22 Feb 2008)
Log Message:
-----------
added some tests
Added Paths:
-----------
simple-build/trunk/test/
simple-build/trunk/test/cpp/
simple-build/trunk/test/cpp/build
simple-build/trunk/test/cpp/myapp.cc
simple-build/trunk/test/java/
simple-build/trunk/test/java/MyApp.java
simple-build/trunk/test/java/build
simple-build/trunk/test/scala/
simple-build/trunk/test/scala/MyApp.scala
simple-build/trunk/test/scala/build
Added: simple-build/trunk/test/cpp/build
===================================================================
--- simple-build/trunk/test/cpp/build (rev 0)
+++ simple-build/trunk/test/cpp/build 2008-02-22 19:25:34 UTC (rev 477)
@@ -0,0 +1,2 @@
+myapp:
+ srcs: [myapp.cc]
Added: simple-build/trunk/test/cpp/myapp.cc
===================================================================
--- simple-build/trunk/test/cpp/myapp.cc (rev 0)
+++ simple-build/trunk/test/cpp/myapp.cc 2008-02-22 19:25:34 UTC (rev 477)
@@ -0,0 +1,10 @@
+#include <iostream>
+
+using namespace std;
+
+int
+main()
+{
+ cout << "hello, world!" << endl;
+ return 0;
+}
Added: simple-build/trunk/test/java/MyApp.java
===================================================================
--- simple-build/trunk/test/java/MyApp.java (rev 0)
+++ simple-build/trunk/test/java/MyApp.java 2008-02-22 19:25:34 UTC (rev 477)
@@ -0,0 +1,5 @@
+public class MyApp {
+ public static void main(String[] args) {
+ System.out.println("hello, world!");
+ }
+}
Added: simple-build/trunk/test/java/build
===================================================================
--- simple-build/trunk/test/java/build (rev 0)
+++ simple-build/trunk/test/java/build 2008-02-22 19:25:34 UTC (rev 477)
@@ -0,0 +1,3 @@
+myapp:
+ srcs: [MyApp.java]
+ mainclass: MyApp
Added: simple-build/trunk/test/scala/MyApp.scala
===================================================================
--- simple-build/trunk/test/scala/MyApp.scala (rev 0)
+++ simple-build/trunk/test/scala/MyApp.scala 2008-02-22 19:25:34 UTC (rev 477)
@@ -0,0 +1,5 @@
+object MyApp {
+ def main(args: Array[String]) {
+ println("hello, world!")
+ }
+}
Added: simple-build/trunk/test/scala/build
===================================================================
--- simple-build/trunk/test/scala/build (rev 0)
+++ simple-build/trunk/test/scala/build 2008-02-22 19:25:34 UTC (rev 477)
@@ -0,0 +1,3 @@
+myapp:
+ srcs: [MyApp.scala]
+ mainclass: MyApp
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-02-24 01:11:46
|
Revision: 481
http://assorted.svn.sourceforge.net/assorted/?rev=481&view=rev
Author: yangzhang
Date: 2008-02-23 17:11:46 -0800 (Sat, 23 Feb 2008)
Log Message:
-----------
exploratory code
Added Paths:
-----------
simple-build/trunk/experimental/
simple-build/trunk/experimental/Schema1.scala
simple-build/trunk/experimental/Schema2
Added: simple-build/trunk/experimental/Schema1.scala
===================================================================
--- simple-build/trunk/experimental/Schema1.scala (rev 0)
+++ simple-build/trunk/experimental/Schema1.scala 2008-02-24 01:11:46 UTC (rev 481)
@@ -0,0 +1,166 @@
+//
+// Attribute types
+//
+
+class Void
+object Null extends Void
+
+abstract class Attr {
+ def valid: Boolean
+}
+case class Str extends Attr {
+ var value: Option[String] = None
+ var isSet = false
+ def :=(n: Void) = {
+ value = None
+ isSet = true
+ this
+ }
+ def :=(s: String) = {
+ value = Some(s)
+ isSet = true
+ this
+ }
+ override def valid = isSet
+ def get = {
+ if (!valid) throw new Exception("unset!")
+ value.get
+ }
+ override def toString = getClass.getName + "(" + value + ")"
+}
+case class Sym extends Str
+case class Path(val baseDir: String) extends Str
+case class AttrList extends Attr {
+ import scala.collection.mutable.ArrayBuffer
+ var values: Option[ArrayBuffer[String]] = None
+ def :=(n: Void) = {
+ values = Some(new ArrayBuffer)
+ this
+ }
+ def :=(xs: Seq[String]) = {
+ if (values == None) values = Some(new ArrayBuffer)
+ values.get ++= xs
+ this
+ }
+ def +=(x: String) = {
+ if (values == None) values = Some(new ArrayBuffer)
+ values.get += x
+ this
+ }
+ def valid = !values.isEmpty
+ def get = values.get mkString ","
+ override def toString =
+ getClass.getName + "(" + (values map (_ mkString ",")) + ")"
+}
+case class PathList(val baseDir: String) extends AttrList
+case class SymList extends AttrList
+object Implicits {
+ implicit def Str2String(s: Str) = s.get
+ implicit def AttrList2String(xs: AttrList) = xs.get
+}
+import Implicits._
+
+//
+// Target types
+//
+
+trait Target {
+ val name = Sym()
+ val version = Str() := Null
+ val descrip = Str() := Null
+ val srcs = PathList(srcdir)
+ val compiler = Str()
+ def emit: String
+ def valid = true
+ // XXX
+// def valid = {
+// this.getClass.getMethods map (
+// _.get(this)) filter (
+// _.isInstanceOf[Attr]) forall (
+// _.asInstanceOf[Attr]valid)
+// }
+}
+
+trait JavaPlatformTarget extends Target {
+ val classpath = PathList(srcdir) := Null
+ override def emit = <p>
+ name {name}
+ version {version}
+ descrip {descrip}
+ srcs {srcs}
+ compiler {compiler}
+ classpath {classpath}
+ </p>.text
+}
+trait JavaPlatformLibrary extends JavaPlatformTarget
+trait JavaPlatformProgram extends JavaPlatformTarget {
+ val mainclass = Sym()
+ val runner = Str()
+}
+
+trait JavaLanguageMixin extends Target {
+ compiler := "javac"
+}
+case class JavaLanguageLibrary extends JavaPlatformLibrary with JavaLanguageMixin
+case class JavaLanguageProgram extends JavaPlatformProgram with JavaLanguageMixin {
+ runner := "java"
+}
+
+trait ScalaMixin extends Target {
+ compiler := "fsc"
+}
+case class ScalaLibrary extends JavaPlatformLibrary with ScalaMixin
+case class ScalaProgram extends JavaPlatformProgram with ScalaMixin {
+ runner := "scala"
+}
+
+trait NativeTarget extends Target {
+ val libs = SymList() := Null
+ val libpaths = PathList(srcdir) := Null
+ val ldflags = Str() := Null
+ override def emit = <p>
+ name {name}
+ version {version}
+ descrip {descrip}
+ srcs {srcs}
+ compiler {compiler}
+ libs {libs}
+ libpaths {libpaths}
+ ldflags {ldflags}
+ </p>.text
+}
+
+trait NativeProgram extends NativeTarget
+trait NativeLibrary extends NativeTarget
+
+trait CMixin extends Target {
+ compiler := "gcc"
+ val cflags = Str() := Null
+}
+trait CppMixin extends Target {
+ compiler := "g++"
+ val cxxflags = Str() := Null
+}
+
+trait CProgram extends NativeProgram with CMixin
+trait CLibrary extends NativeLibrary with CMixin
+
+case class CppProgram extends NativeProgram with CppMixin
+case class CppLibrary extends NativeLibrary with CppMixin
+
+//
+// Test
+//
+
+object SchemaTest extends Application {
+ val cpp = new CppProgram {
+ name := "hello"
+ srcs := List("hello.cc")
+ }
+ println(cpp.emit)
+ val java = new JavaLanguageProgram {
+ name := "Hello"
+ srcs := List("Hello.java")
+ }
+ println(java.emit)
+}
Added: simple-build/trunk/experimental/Schema2
===================================================================
--- simple-build/trunk/experimental/Schema2 (rev 0)
+++ simple-build/trunk/experimental/Schema2 2008-02-24 01:11:46 UTC (rev 481)
@@ -0,0 +1,101 @@
+target:
+ fields:
+ name: sym
+ version: str
+ descrip: str
+ srcs: pathlist
+ compiler: str
+ overrides:
+ version:
+ descrip:
+
+java platform target:
+ extends:
+ target
+ fields:
+ classpath: pathlist
+
+java platform program:
+ extends:
+ java platform target
+ fields:
+ mainclass: sym
+ runner: str
+
+java language:
+ extends:
+ target
+ overrides:
+ compiler: "javac"
+ applies to: java platform
+
+java program:
+ extends:
+ java platform program + java language
+ overrides:
+ runner: "java"
+
+scala language:
+ extends: [target]
+ overrides:
+ compiler: "javac"
+ applies to: java platform
+
+scala program:
+ extends:
+ java platform program + scala language
+ name: Hello
+ runner: scala
+
+native target:
+ extends:
+ target
+ fields:
+ flags: strlist
+ overrides:
+ flags: []
+
+c++:
+ extends:
+ native target
+ overrides:
+ compiler: g++
+ applies to: native target
+
+c:
+ extends:
+ native target
+ overrides:
+ compiler: gcc
+ applies to: native target
+
+complete native:
+ extends:
+ native target:
+ name: name + "-gprof" // TODO how to do this?
+ flags: [-pg]
+ native target:
+ name: name + "-opt"
+ flags: [-O3]
+ native target:
+ name: name + "-dbg"
+ flags: [-g3]
+
+c++ program:
+ extends:
+ complete native + c++
+
+c program:
+ extends:
+ complete native + c
+
+=====
+
+java program:
+ name: Hello
+ version: 0.1
+ srcs: [Hello.java]
+
+c++ program:
+ name: hello
+ srcs: [hello.cc]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-02-29 03:58:54
|
Revision: 527
http://assorted.svn.sourceforge.net/assorted/?rev=527&view=rev
Author: yangzhang
Date: 2008-02-28 19:59:00 -0800 (Thu, 28 Feb 2008)
Log Message:
-----------
added web publishing script
Modified Paths:
--------------
simple-build/trunk/README
simple-build/trunk/src/build-templates/cpp
Added Paths:
-----------
simple-build/trunk/publish.bash
Modified: simple-build/trunk/README
===================================================================
--- simple-build/trunk/README 2008-02-29 03:37:17 UTC (rev 526)
+++ simple-build/trunk/README 2008-02-29 03:59:00 UTC (rev 527)
@@ -111,9 +111,12 @@
is to one day be able to generate `autotools` inputs (as well as other kinds
of software packaging).
-- [Boost.Build]: A system for building C++ projects. Documentation hints that
- it is capable of discovering transitive dependencies as well. This seems like
- the closest thing to what I wanted.
+- [Boost.Build]: A system for building C++ projects. Can discover only
+ transitive dependencies that can be found without relying on implicit
+ locations (such as those that are found via gcc's `CPATH`, `C_INCLUDE_PATH`,
+ `CXX_INCLUDE_PATH`, etc.). Contains a scripting language that I'm still
+ learning, but for simple configs, the language is terse and appears nice. The
+ community doesn't seem to be as active as CMake's.
- [GNU `make`]: Currently, SimpleBuild targets only `make`.
@@ -139,9 +142,9 @@
database came from here.
- [CMake]: Cross-platform `make`. Uses its own quirky scripting language and
- has quite a few features. I should probably target this. ["Why the KDE
- project switched to CMake"] is a nice article on CMake (vs. auto* and SCons).
- I've been using CMake as well.
+ has quite a few features. Kind of ugly. As always, long-tail configurations
+ are more painful. ["Why the KDE project switched to CMake"] is a nice article
+ on CMake (vs. auto* and SCons). I should target this.
- [WAF]: An even simpler/more barren build system. You actually write
imperative scripts for each build you need. A bit scary.
Added: simple-build/trunk/publish.bash
===================================================================
--- simple-build/trunk/publish.bash (rev 0)
+++ simple-build/trunk/publish.bash 2008-02-29 03:59:00 UTC (rev 527)
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+clean=true
+project=simple-build
+websrcs=( README )
+webfiles=()
+. assorted.bash || exit 1
Property changes on: simple-build/trunk/publish.bash
___________________________________________________________________
Name: svn:executable
+ *
Modified: simple-build/trunk/src/build-templates/cpp
===================================================================
--- simple-build/trunk/src/build-templates/cpp 2008-02-29 03:37:17 UTC (rev 526)
+++ simple-build/trunk/src/build-templates/cpp 2008-02-29 03:59:00 UTC (rev 527)
@@ -1,6 +1,7 @@
OBJDIR := $(OUTDIR)/$(TARGET)-obj
-CFLAGS := $(CFLAGS) $(FLAGS)
-CXXFLAGS := $(CXXFLAGS) $(FLAGS)
+FLAGS := -Wall -Werror $(FLAGS)
+CFLAGS := $(FLAGS) $(CFLAGS)
+CXXFLAGS := $(FLAGS) $(CXXFLAGS)
CPPFLAGS := $(CPPFLAGS)
LDFLAGS := $(LDFLAGS) $(LIBS) $(AUTOLIBS)
EXE := $(OUTDIR)/$(TARGET)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-03-01 06:21:37
|
Revision: 552
http://assorted.svn.sourceforge.net/assorted/?rev=552&view=rev
Author: yangzhang
Date: 2008-02-29 22:21:37 -0800 (Fri, 29 Feb 2008)
Log Message:
-----------
added googlecode_upload.py
Modified Paths:
--------------
simple-build/trunk/README
Added Paths:
-----------
simple-build/trunk/src/googlecode_upload.py
Modified: simple-build/trunk/README
===================================================================
--- simple-build/trunk/README 2008-02-29 17:00:10 UTC (rev 551)
+++ simple-build/trunk/README 2008-03-01 06:21:37 UTC (rev 552)
@@ -25,6 +25,14 @@
header-to-library mappings
- in-place or out-of-place builds
+This package also contains a patched version of [`googlecode_upload.py`] that can
+use an alternate, simpler auth data file than subversion's cached auth data
+(which is [currently broken]). This version uses a file `~/.googlecode.auth`
+(with permissions 600) containing your username and password on separate lines.
+
+[`googlecode_upload.py`]: http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py
+[currently broken]: http://code.google.com/p/support/issues/detail?id=558
+
Requirements
------------
Added: simple-build/trunk/src/googlecode_upload.py
===================================================================
--- simple-build/trunk/src/googlecode_upload.py (rev 0)
+++ simple-build/trunk/src/googlecode_upload.py 2008-03-01 06:21:37 UTC (rev 552)
@@ -0,0 +1,325 @@
+#!/usr/bin/env python
+#
+# Copyright 2006, 2007 Google Inc. All Rights Reserved.
+# Author: dan...@go... (David Anderson)
+#
+# Script for uploading files to a Google Code project.
+#
+# This is intended to be both a useful script for people who want to
+# streamline project uploads and a reference implementation for
+# uploading files to Google Code projects.
+#
+# To upload a file to Google Code, you need to provide a path to the
+# file on your local machine, a small summary of what the file is, a
+# project name, and a valid account that is a member or owner of that
+# project. You can optionally provide a list of labels that apply to
+# the file. The file will be uploaded under the same name that it has
+# in your local filesystem (that is, the "basename" or last path
+# component). Run the script with '--help' to get the exact syntax
+# and available options.
+#
+# Note that the upload script requests that you enter your
+# googlecode.com password. This is NOT your Gmail account password!
+# This is the password you use on googlecode.com for committing to
+# Subversion and uploading files. You can find your password by going
+# to http://code.google.com/hosting/settings when logged in with your
+# Gmail account. If you have already committed to your project's
+# Subversion repository, the script will automatically retrieve your
+# credentials from there (unless disabled, see the output of '--help'
+# for details).
+#
+# If you are looking at this script as a reference for implementing
+# your own Google Code file uploader, then you should take a look at
+# the upload() function, which is the meat of the uploader. You
+# basically need to build a multipart/form-data POST request with the
+# right fields and send it to https://PROJECT.googlecode.com/files .
+# Authenticate the request using HTTP Basic authentication, as is
+# shown below.
+#
+# Licensed under the terms of the Apache Software License 2.0:
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Questions, comments, feature requests and patches are most welcome.
+# Please direct all of these to the Google Code users group:
+# http://groups.google.com/group/google-code-hosting
+
+"""Google Code file uploader script.
+"""
+
+from __future__ import with_statement
+
+__author__ = 'dan...@go... (David Anderson)'
+
+import httplib
+import os.path
+import optparse
+import getpass
+import base64
+import sys
+
+
+def get_svn_config_dir():
+ """Return user's Subversion configuration directory."""
+ try:
+ from win32com.shell.shell import SHGetFolderPath
+ import win32com.shell.shellcon
+ except ImportError:
+ # If we can't import the win32api, just use ~; this is right on unix, and
+ # returns not entirely unreasonable results on Windows.
+ return os.path.expanduser('~/.subversion')
+
+ # We're on Windows with win32api; use APPDATA.
+ return os.path.join(SHGetFolderPath(0, win32com.shell.shellcon.CSIDL_APPDATA,
+ 0, 0).encode('utf-8'),
+ 'Subversion')
+
+
+def get_svn_auth(project_name, config_dir):
+ """Return (username, password) for project_name in config_dir."""
+
+ # Default to returning nothing.
+ result = (None, None)
+
+ try:
+ from svn.core import SVN_AUTH_CRED_SIMPLE, svn_config_read_auth_data
+ from svn.core import SubversionException
+ except ImportError:
+ return result
+
+ realm = ('<https://%s.googlecode.com:443> Google Code Subversion Repository'
+ % project_name)
+
+ # auth may be none even if no exception is raised, e.g. if config_dir does
+ # not exist, or exists but has no entry for realm.
+ try:
+ auth = svn_config_read_auth_data(SVN_AUTH_CRED_SIMPLE, realm, config_dir)
+ except SubversionException:
+ auth = None
+
+ if auth is not None:
+ try:
+ result = (auth['username'], auth['password'])
+ except KeyError:
+ # Missing the keys, so return nothing.
+ pass
+
+ return result
+
+
+def upload(file, project_name, user_name, password, summary, labels=None):
+ """Upload a file to a Google Code project's file server.
+
+ Args:
+ file: The local path to the file.
+ project_name: The name of your project on Google Code.
+ user_name: Your Google account name.
+ password: The googlecode.com password for your account.
+ Note that this is NOT your global Google Account password!
+ summary: A small description for the file.
+ labels: an optional list of label strings with which to tag the file.
+
+ Returns: a tuple:
+ http_status: 201 if the upload succeeded, something else if an
+ error occured.
+ http_reason: The human-readable string associated with http_status
+ file_url: If the upload succeeded, the URL of the file on Google
+ Code, None otherwise.
+ """
+ # The login is the user part of us...@gm.... If the login provided
+ # is in the full user@domain form, strip it down.
+ if '@' in user_name:
+ user_name = user_name[:user_name.index('@')]
+
+ form_fields = [('summary', summary)]
+ if labels is not None:
+ form_fields.extend([('label', l.strip()) for l in labels])
+
+ content_type, body = encode_upload_request(form_fields, file)
+
+ upload_host = '%s.googlecode.com' % project_name
+ upload_uri = '/files'
+ auth_token = base64.b64encode('%s:%s'% (user_name, password))
+ headers = {
+ 'Authorization': 'Basic %s' % auth_token,
+ 'User-Agent': 'Googlecode.com uploader v0.9.4',
+ 'Content-Type': content_type,
+ }
+
+ server = httplib.HTTPSConnection(upload_host)
+ server.request('POST', upload_uri, body, headers)
+ resp = server.getresponse()
+ server.close()
+
+ if resp.status == 201:
+ location = resp.getheader('Location', None)
+ else:
+ location = None
+ return resp.status, resp.reason, location
+
+
+def encode_upload_request(fields, file_path):
+ """Encode the given fields and file into a multipart form body.
+
+ fields is a sequence of (name, value) pairs. file is the path of
+ the file to upload. The file will be uploaded to Google Code with
+ the same file name.
+
+ Returns: (content_type, body) ready for httplib.HTTP instance
+ """
+ BOUNDARY = '----------Googlecode_boundary_reindeer_flotilla'
+ CRLF = '\r\n'
+
+ body = []
+
+ # Add the metadata about the upload first
+ for key, value in fields:
+ body.extend(
+ ['--' + BOUNDARY,
+ 'Content-Disposition: form-data; name="%s"' % key,
+ '',
+ value,
+ ])
+
+ # Now add the file itself
+ file_name = os.path.basename(file_path)
+ f = open(file_path, 'rb')
+ file_content = f.read()
+ f.close()
+
+ body.extend(
+ ['--' + BOUNDARY,
+ 'Content-Disposition: form-data; name="filename"; filename="%s"'
+ % file_name,
+ # The upload server determines the mime-type, no need to set it.
+ 'Content-Type: application/octet-stream',
+ '',
+ file_content,
+ ])
+
+ # Finalize the form body
+ body.extend(['--' + BOUNDARY + '--', ''])
+
+ return 'multipart/form-data; boundary=%s' % BOUNDARY, CRLF.join(body)
+
+
+def get_basic_auth():
+ try:
+ os.path.expanduser('~/.googlecode.auth')
+ with file(os.path.expanduser('~/.googlecode.auth')) as f:
+ return [ line.strip() for line in f ]
+ except:
+ print 'crap'
+ return None, None
+
+def upload_find_auth(file_path, project_name, summary, labels=None,
+ config_dir=None, user_name=None, tries=3):
+ """Find credentials and upload a file to a Google Code project's file server.
+
+ file_path, project_name, summary, and labels are passed as-is to upload.
+
+ If config_dir is None, try get_svn_config_dir(); if it is 'none', skip
+ trying the Subversion configuration entirely. If user_name is not None, use
+ it for the first attempt; prompt for subsequent attempts.
+
+ Args:
+ file_path: The local path to the file.
+ project_name: The name of your project on Google Code.
+ summary: A small description for the file.
+ labels: an optional list of label strings with which to tag the file.
+ config_dir: Path to Subversion configuration directory, 'none', or None.
+ user_name: Your Google account name.
+ tries: How many attempts to make.
+ """
+
+ if config_dir != 'none':
+ # Try to load username/password from svn config for first try.
+ if config_dir is None:
+ config_dir = get_svn_config_dir()
+ (svn_username, password) = (None, None) # get_svn_auth(project_name, config_dir)
+ if user_name is None:
+ # If username was not supplied by caller, use svn config.
+ user_name = svn_username
+ else:
+ user_name, password = get_basic_auth()
+ else:
+ # Just initialize password for the first try.
+ password = None
+
+ while tries > 0:
+ if user_name is None:
+ # Read username if not specified or loaded from svn config, or on
+ # subsequent tries.
+ sys.stdout.write('Please enter your googlecode.com username: ')
+ sys.stdout.flush()
+ user_name = sys.stdin.readline().rstrip()
+ if password is None:
+ # Read password if not loaded from svn config, or on subsequent tries.
+ print 'Please enter your googlecode.com password.'
+ print '** Note that this is NOT your Gmail account password! **'
+ print 'It is the password you use to access Subversion repositories,'
+ print 'and can be found here: http://code.google.com/hosting/settings'
+ password = getpass.getpass()
+
+ status, reason, url = upload(file_path, project_name, user_name, password,
+ summary, labels)
+ # Returns 403 Forbidden instead of 401 Unauthorized for bad
+ # credentials as of 2007-07-17.
+ if status in [httplib.FORBIDDEN, httplib.UNAUTHORIZED]:
+ # Rest for another try.
+ user_name = password = None
+ tries = tries - 1
+ else:
+ # We're done.
+ break
+
+ return status, reason, url
+
+
+def main():
+ parser = optparse.OptionParser(usage='googlecode-upload.py -s SUMMARY '
+ '-p PROJECT [options] FILE')
+ parser.add_option('--config-dir', dest='config_dir', metavar='DIR',
+ help='read svn auth data from DIR'
+ ' ("none" means not to use svn auth data)')
+ parser.add_option('-s', '--summary', dest='summary',
+ help='Short description of the file')
+ parser.add_option('-p', '--project', dest='project',
+ help='Google Code project name')
+ parser.add_option('-u', '--user', dest='user',
+ help='Your Google Code username')
+ parser.add_option('-l', '--labels', dest='labels',
+ help='An optional list of labels to attach to the file')
+
+ options, args = parser.parse_args()
+
+ if not options.summary:
+ parser.error('File summary is missing.')
+ elif not options.project:
+ parser.error('Project name is missing.')
+ elif len(args) < 1:
+ parser.error('File to upload not provided.')
+ elif len(args) > 1:
+ parser.error('Only one file may be specified.')
+
+ file_path = args[0]
+
+ if options.labels:
+ labels = options.labels.split(',')
+ else:
+ labels = None
+
+ status, reason, url = upload_find_auth(file_path, options.project,
+ options.summary, labels,
+ options.config_dir, options.user)
+ if url:
+ print 'The file was uploaded successfully.'
+ print 'URL: %s' % url
+ return 0
+ else:
+ print 'An error occurred. Your file was not uploaded.'
+ print 'Google Code upload server said: %s (%s)' % (reason, status)
+ return 1
+
+
+if __name__ == '__main__':
+ sys.exit(main())
Property changes on: simple-build/trunk/src/googlecode_upload.py
___________________________________________________________________
Name: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-03-05 06:10:46
|
Revision: 602
http://assorted.svn.sourceforge.net/assorted/?rev=602&view=rev
Author: yangzhang
Date: 2008-03-04 22:10:46 -0800 (Tue, 04 Mar 2008)
Log Message:
-----------
moved setup.bash to project root
Added Paths:
-----------
simple-build/trunk/setup.bash
Removed Paths:
-------------
simple-build/trunk/src/setup.bash
Copied: simple-build/trunk/setup.bash (from rev 593, simple-build/trunk/src/setup.bash)
===================================================================
--- simple-build/trunk/setup.bash (rev 0)
+++ simple-build/trunk/setup.bash 2008-03-05 06:10:46 UTC (rev 602)
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+pkg=simple-build
+. simple-setup.bash
+
+install_strip bin/ src/googlecode_upload.py
+install bin/ src/{build.bash,capture-javac-deps,out/simple-build}
+install share/$pkg/ src/build-templates
Deleted: simple-build/trunk/src/setup.bash
===================================================================
--- simple-build/trunk/src/setup.bash 2008-03-05 05:49:10 UTC (rev 601)
+++ simple-build/trunk/src/setup.bash 2008-03-05 06:10:46 UTC (rev 602)
@@ -1,8 +0,0 @@
-#!/usr/bin/env bash
-
-pkg=simple-build
-. simple-setup.bash
-
-install_strip bin/ googlecode_upload.py
-install bin/ build.bash capture-javac-deps out/simple-build
-install share/$pkg/ build-templates
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|