Commit bbd665a5 authored by nyquist's avatar nyquist Committed by Commit bot

Update DOM Distiller roll script DEPS in out/package.

Update roll-script to DEPS in the package instead of checking it
in. The new package folder lives at a new place to ensure there
are no issues when rolling back or forward from this CL. The new
location is:
//third_party/dom_distiller_js/dist.

After running `ant package`, the roll-script now takes the content
from out/package and pushes it to an external repository on
GitHub (chromium/dom-distiller-dist) and updates DEPS for
that repo to refer to the newly pushed version.

BUG=467787

Review URL: https://codereview.chromium.org/987793002

Cr-Commit-Position: refs/heads/master@{#321576}
parent c68d47f7
......@@ -286,6 +286,7 @@ v8.log
/third_party/cros_system_api
/third_party/cygwin
/third_party/directxsdk
/third_party/dom_distiller_js/dist
/third_party/drmemory/drmemory-windows-sfx.exe
/third_party/drmemory/unpacked
/third_party/elfutils/src
......
......@@ -290,6 +290,9 @@ deps = {
'src/third_party/py_trace_event/src':
Var('chromium_git') + '/external/py_trace_event.git' + '@' + 'dd463ea9e2c430de2b9e53dea57a77b4c3ac9b30',
'src/third_party/dom_distiller_js/dist':
Var('chromium_git') + '/external/github.com/chromium/dom-distiller-dist.git' + '@' + '964272de851ef5d5d1096d319526b992d8d3d7f6',
}
......
......@@ -2072,6 +2072,11 @@
'-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
'--no-output-all-resource-defines',
],
'conditions': [
['<(android_webview_build)==1', {
'grit_defines': ['-D', 'is_android_webview_build'],
}],
],
}],
['OS=="mac" or OS=="ios"', {
'grit_defines': ['-D', 'scale_factors=2x'],
......
......@@ -12,7 +12,7 @@
// context so that it doesn't change the real window object.
function initialize(window) {
// This include will be processed at build time by grit.
<include src="../../../../third_party/dom_distiller_js/package/js/domdistiller.js"/>
<include src="../../../../third_party/dom_distiller_js/dist/js/domdistiller.js"/>
}
var context = use_new_context ? Object.create(window) : window
context.setTimeout = function() {};
......
......@@ -9,7 +9,9 @@
<release seq="1">
<includes>
<part file="data_reduction_proxy_resources.grdp" />
<part file="dom_distiller_resources.grdp" />
<if expr="not is_android_webview_build">
<part file="dom_distiller_resources.grdp" />
</if>
<part file="printing_resources.grdp" />
<part file="translate_resources.grdp" />
<part file="webui_generator_resources.grdp" />
......
......@@ -5,7 +5,7 @@
import("//third_party/protobuf/proto_library.gni")
config("dependent_config") {
include_dirs = [ "//third_party/dom_distiller_js/package/proto_gen" ]
include_dirs = [ "//third_party/dom_distiller_js/dist/proto_gen" ]
}
source_set("proto") {
......@@ -18,7 +18,7 @@ source_set("proto") {
proto_library("dom_distiller_proto") {
visibility = [ ":*" ]
sources = [
"package/proto/dom_distiller.proto",
"dist/proto/dom_distiller.proto",
]
proto_out_dir = "third_party/dom_distiller_js"
}
......@@ -7,13 +7,13 @@
# GN version: //third_party/dom_distiller_js:proto
'target_name': 'dom_distiller_js_proto',
'type': 'static_library',
'sources': [ 'package/proto/dom_distiller.proto', ],
'sources': [ 'dist/proto/dom_distiller.proto', ],
'variables': {
'proto_in_dir': 'package/proto',
'proto_in_dir': 'dist/proto',
'proto_out_dir': 'third_party/dom_distiller_js',
},
'direct_dependent_settings': {
'include_dirs': ['package/proto_gen'],
'include_dirs': ['dist/proto_gen'],
},
'includes': [ '../../build/protoc.gypi', ],
}
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
package dom_distiller.proto;
option optimize_for = LITE_RUNTIME;
option java_package = "org.chromium.distiller.proto";
option java_outer_classname = "DomDistillerProtos";
message DistilledContent {
optional string html = 1;
}
message PaginationInfo {
optional string next_page = 1;
optional string prev_page = 2;
optional string canonical_page = 3;
}
message MarkupArticle {
optional string published_time = 1;
optional string modified_time = 2;
optional string expiration_time = 3;
optional string section = 4;
repeated string authors = 5;
}
message MarkupImage {
optional string url = 1;
optional string secure_url = 2;
optional string type = 3;
optional string caption = 4;
optional int32 width = 5;
optional int32 height = 6;
}
message MarkupInfo {
optional string title = 1;
optional string type = 2;
optional string url = 3;
optional string description = 4;
optional string publisher = 5;
optional string copyright = 6;
optional string author = 7;
optional MarkupArticle article = 8;
repeated MarkupImage images = 9;
}
message TimingEntry {
optional string name = 1;
optional double time = 2;
}
message TimingInfo {
optional double markup_parsing_time = 1;
optional double document_construction_time = 2;
optional double article_processing_time = 3;
optional double formatting_time = 4;
optional double total_time = 5;
// A place to hold arbitrary breakdowns of time. The perf scoring/server
// should display these entries with appropriate names.
repeated TimingEntry other_times = 6;
}
message DebugInfo {
optional string log = 1;
}
message StatisticsInfo {
optional int32 word_count = 1;
}
message DomDistillerResult {
optional string title = 1;
optional DistilledContent distilled_content = 2;
optional PaginationInfo pagination_info = 3;
optional MarkupInfo markup_info = 5;
optional TimingInfo timing_info = 6;
optional DebugInfo debug_info = 7;
optional StatisticsInfo statistics_info = 8;
optional string text_direction = 9;
// Represents an image found in the content of a page.
message ContentImage {
optional string url = 1;
}
repeated ContentImage content_images = 10;
}
message DomDistillerOptions {
// Whether to extract only the text (or to include the containing html).
optional bool extract_text_only = 1;
// How much debug output to dump to window.console.
// (0): Logs nothing
// (1): Text Node data for each stage of processing
// (2): (1) and some node visibility information
// (3): (2) and extracted paging information
optional int32 debug_level = 2;
// The original URL of the page, which is used in the heuristics in
// detecting next/prev page links.
optional string original_url = 3;
}
......@@ -15,7 +15,6 @@
set -e
dom_distiller_js_path=third_party/dom_distiller_js
dom_distiller_js_package=$dom_distiller_js_path/package
readme_chromium=$dom_distiller_js_path/README.chromium
tmpdir=/tmp/domdistiller-$$
changes=$tmpdir/domdistiller.changes
......@@ -24,9 +23,10 @@
rm -rf $tmpdir
mkdir $tmpdir
pushd $tmpdir
git clone https://github.com/chromium/dom-distiller/ .
git clone https://github.com/chromium/dom-distiller.git
pushd dom-distiller
# The new git SHA1 is HEAD or the first command line parameter.
[[ -z "$1" ]] && gitsha_target="HEAD" || gitsha_target="$1"
......@@ -52,17 +52,40 @@
echo >> $bugs # add a newline
ant package
popd
rm -rf $dom_distiller_js_package
mkdir $dom_distiller_js_package
cp -rf $tmpdir/out/package/* $dom_distiller_js_package
git add $dom_distiller_js_package
cp $tmpdir/LICENSE $dom_distiller_js_path/
sed -i "s/Version: [0-9a-f]*/Version: $new_gitsha/" $readme_chromium
popd # dom-distiller
git clone https://github.com/chromium/dom-distiller-dist.git $tmpdir/dom-distiller-dist
rm -rf $tmpdir/dom-distiller-dist/*
pushd dom-distiller-dist
cp -r $tmpdir/dom-distiller/out/package/* .
git add .
if [[ $(git status --short | wc -l) -ne 0 ]]; then
git commit -a -m "Package for ${new_gitsha}"
git push origin master
else
# No changes to external repo, but need to check if DEPS refers to same SHA1.
echo "WARNING: There were no changes to the distribution package."
fi
new_dist_gitsha=$(git rev-parse HEAD)
popd # dom-distiller-dist
popd # tmpdir
curr_dist_gitsha=$(grep -e "/external\/github.com\/chromium\/dom-distiller-dist.git" DEPS | sed -e "s/.*'\([A-Za-z0-9]\{40\}\)'.*/\1/g")
if [[ "${new_dist_gitsha}" == "${curr_dist_gitsha}" ]]; then
echo "The roll does not include any changes to the dist package. Exiting."
rm -rf $tmpdir
exit 1
fi
cp $tmpdir/dom-distiller/LICENSE $dom_distiller_js_path/
sed -i "s/Version: [0-9a-f]*/Version: ${new_gitsha}/" $readme_chromium
sed -i -e "s/\('\/external\/github.com\/chromium\/dom-distiller-dist.git' + '@' + '\)\([0-9a-f]\+\)'/\1${new_dist_gitsha}'/" DEPS
gen_message () {
echo "Roll DomDistillerJS"
echo "Roll DOM Distiller JavaScript distribution package"
echo
echo "Diff since last roll:"
echo "https://github.com/chromium/dom-distiller/compare/${curr_gitsha}...${new_gitsha}"
echo
echo "Picked up changes:"
cat $changes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment