Compare commits
22 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7a00c54eac | ||
![]() |
a3b99c075b | ||
![]() |
d59b15b16e | ||
![]() |
f1748f63a2 | ||
![]() |
990da11add | ||
![]() |
c99399d920 | ||
![]() |
e1fa2e2d25 | ||
![]() |
6b4931784a | ||
![]() |
bad0ac6436 | ||
![]() |
4ecfb2f816 | ||
![]() |
fcd41af5d5 | ||
![]() |
406d02174a | ||
![]() |
5e5e3ecd08 | ||
![]() |
2441bc5709 | ||
![]() |
33900345b0 | ||
![]() |
cd13d353c9 | ||
![]() |
37298579b6 | ||
![]() |
19823f2015 | ||
![]() |
fd5ea30be3 | ||
![]() |
a441d97cb1 | ||
![]() |
734a293899 | ||
![]() |
6e254d9b58 |
18 changed files with 150 additions and 116 deletions
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -125,12 +125,12 @@ jobs:
|
|||
- name: Build Zed
|
||||
run: cargo build -p zed
|
||||
bundle:
|
||||
name: Bundle app
|
||||
name: Bundle macOS app
|
||||
runs-on:
|
||||
- self-hosted
|
||||
- bundle
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.pull_request.labels.*.name, 'run-build-dmg') }}
|
||||
needs: [macos_tests, linux_tests]
|
||||
needs: [macos_tests]
|
||||
env:
|
||||
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
||||
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
|
||||
|
|
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -10793,7 +10793,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "zed"
|
||||
version = "0.123.1"
|
||||
version = "0.123.6"
|
||||
dependencies = [
|
||||
"activity_indicator",
|
||||
"ai",
|
||||
|
|
|
@ -122,16 +122,13 @@ impl AssistantPanel {
|
|||
.await
|
||||
.log_err()
|
||||
.unwrap_or_default();
|
||||
let (api_url, model_name) = cx
|
||||
.update(|cx| {
|
||||
let settings = AssistantSettings::get_global(cx);
|
||||
(
|
||||
settings.openai_api_url.clone(),
|
||||
settings.default_open_ai_model.full_name().to_string(),
|
||||
)
|
||||
})
|
||||
.log_err()
|
||||
.unwrap();
|
||||
let (api_url, model_name) = cx.update(|cx| {
|
||||
let settings = AssistantSettings::get_global(cx);
|
||||
(
|
||||
settings.openai_api_url.clone(),
|
||||
settings.default_open_ai_model.full_name().to_string(),
|
||||
)
|
||||
})?;
|
||||
let completion_provider = OpenAiCompletionProvider::new(
|
||||
api_url,
|
||||
model_name,
|
||||
|
|
|
@ -317,8 +317,8 @@ impl PickerDelegate for CommandPaletteDelegate {
|
|||
});
|
||||
let action = command.action;
|
||||
cx.focus(&self.previous_focus_handle);
|
||||
cx.dispatch_action(action);
|
||||
self.dismissed(cx);
|
||||
cx.dispatch_action(action);
|
||||
}
|
||||
|
||||
fn render_match(
|
||||
|
|
|
@ -7660,8 +7660,9 @@ impl Editor {
|
|||
let snapshot = cursor_buffer.read(cx).snapshot();
|
||||
let cursor_buffer_offset = cursor_buffer_position.to_offset(&snapshot);
|
||||
let prepare_rename = project.update(cx, |project, cx| {
|
||||
project.prepare_rename(cursor_buffer, cursor_buffer_offset, cx)
|
||||
project.prepare_rename(cursor_buffer.clone(), cursor_buffer_offset, cx)
|
||||
});
|
||||
drop(snapshot);
|
||||
|
||||
Some(cx.spawn(|this, mut cx| async move {
|
||||
let rename_range = if let Some(range) = prepare_rename.await? {
|
||||
|
@ -7681,11 +7682,12 @@ impl Editor {
|
|||
})?
|
||||
};
|
||||
if let Some(rename_range) = rename_range {
|
||||
let rename_buffer_range = rename_range.to_offset(&snapshot);
|
||||
let cursor_offset_in_rename_range =
|
||||
cursor_buffer_offset.saturating_sub(rename_buffer_range.start);
|
||||
|
||||
this.update(&mut cx, |this, cx| {
|
||||
let snapshot = cursor_buffer.read(cx).snapshot();
|
||||
let rename_buffer_range = rename_range.to_offset(&snapshot);
|
||||
let cursor_offset_in_rename_range =
|
||||
cursor_buffer_offset.saturating_sub(rename_buffer_range.start);
|
||||
|
||||
this.take_rename(false, cx);
|
||||
let buffer = this.buffer.read(cx).read(cx);
|
||||
let cursor_offset = selection.head().to_offset(&buffer);
|
||||
|
|
|
@ -289,6 +289,7 @@ fn show_hover(
|
|||
})?;
|
||||
|
||||
let hover_result = hover_request.await.ok().flatten();
|
||||
let snapshot = this.update(&mut cx, |this, cx| this.snapshot(cx))?;
|
||||
let hover_popover = match hover_result {
|
||||
Some(hover_result) if !hover_result.is_empty() => {
|
||||
// Create symbol range of anchors for highlighting and filtering of future requests.
|
||||
|
|
|
@ -405,6 +405,10 @@ impl ExtensionStore {
|
|||
}));
|
||||
|
||||
for language_name in &languages_to_add {
|
||||
if language_name.as_ref() == "Swift" {
|
||||
continue;
|
||||
}
|
||||
|
||||
let language = manifest.languages.get(language_name.as_ref()).unwrap();
|
||||
let mut language_path = self.extensions_dir.clone();
|
||||
language_path.extend([language.extension.as_ref(), language.path.as_path()]);
|
||||
|
@ -650,6 +654,12 @@ impl ExtensionStore {
|
|||
let Ok(relative_path) = language_path.strip_prefix(&extension_dir) else {
|
||||
continue;
|
||||
};
|
||||
let Ok(Some(fs_metadata)) = fs.metadata(&language_path).await else {
|
||||
continue;
|
||||
};
|
||||
if !fs_metadata.is_dir {
|
||||
continue;
|
||||
}
|
||||
let config = fs.load(&language_path.join("config.toml")).await?;
|
||||
let config = ::toml::from_str::<LanguageConfig>(&config)?;
|
||||
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
use client::telemetry::Telemetry;
|
||||
use editor::{Editor, EditorElement, EditorStyle};
|
||||
use extension::{Extension, ExtensionStatus, ExtensionStore};
|
||||
use fs::Fs;
|
||||
use gpui::{
|
||||
actions, canvas, uniform_list, AnyElement, AppContext, AvailableSpace, EventEmitter,
|
||||
FocusableView, FontStyle, FontWeight, InteractiveElement, KeyContext, ParentElement, Render,
|
||||
Styled, Task, TextStyle, UniformListScrollHandle, View, ViewContext, VisualContext, WeakView,
|
||||
WhiteSpace, WindowContext,
|
||||
Styled, Task, TextStyle, UniformListScrollHandle, View, ViewContext, VisualContext, WhiteSpace,
|
||||
WindowContext,
|
||||
};
|
||||
use settings::Settings;
|
||||
use std::time::Duration;
|
||||
|
@ -32,8 +31,6 @@ pub fn init(cx: &mut AppContext) {
|
|||
}
|
||||
|
||||
pub struct ExtensionsPage {
|
||||
workspace: WeakView<Workspace>,
|
||||
fs: Arc<dyn Fs>,
|
||||
list: UniformListScrollHandle,
|
||||
telemetry: Arc<Telemetry>,
|
||||
is_fetching_extensions: bool,
|
||||
|
@ -46,7 +43,7 @@ pub struct ExtensionsPage {
|
|||
|
||||
impl ExtensionsPage {
|
||||
pub fn new(workspace: &Workspace, cx: &mut ViewContext<Workspace>) -> View<Self> {
|
||||
let extensions_panel = cx.new_view(|cx: &mut ViewContext<Self>| {
|
||||
cx.new_view(|cx: &mut ViewContext<Self>| {
|
||||
let store = ExtensionStore::global(cx);
|
||||
let subscription = cx.observe(&store, |_, _, cx| cx.notify());
|
||||
|
||||
|
@ -54,8 +51,6 @@ impl ExtensionsPage {
|
|||
cx.subscribe(&query_editor, Self::on_query_change).detach();
|
||||
|
||||
let mut this = Self {
|
||||
fs: workspace.project().read(cx).fs().clone(),
|
||||
workspace: workspace.weak_handle(),
|
||||
list: UniformListScrollHandle::new(),
|
||||
telemetry: workspace.client().telemetry().clone(),
|
||||
is_fetching_extensions: false,
|
||||
|
@ -67,8 +62,7 @@ impl ExtensionsPage {
|
|||
};
|
||||
this.fetch_extensions(None, cx);
|
||||
this
|
||||
});
|
||||
extensions_panel
|
||||
})
|
||||
}
|
||||
|
||||
fn install_extension(
|
||||
|
@ -453,25 +447,9 @@ impl Item for ExtensionsPage {
|
|||
fn clone_on_split(
|
||||
&self,
|
||||
_workspace_id: WorkspaceId,
|
||||
cx: &mut ViewContext<Self>,
|
||||
_: &mut ViewContext<Self>,
|
||||
) -> Option<View<Self>> {
|
||||
Some(cx.new_view(|cx| {
|
||||
let store = ExtensionStore::global(cx);
|
||||
let subscription = cx.observe(&store, |_, _, cx| cx.notify());
|
||||
|
||||
ExtensionsPage {
|
||||
fs: self.fs.clone(),
|
||||
workspace: self.workspace.clone(),
|
||||
list: UniformListScrollHandle::new(),
|
||||
telemetry: self.telemetry.clone(),
|
||||
is_fetching_extensions: false,
|
||||
extensions_entries: Default::default(),
|
||||
query_editor: self.query_editor.clone(),
|
||||
_subscription: subscription,
|
||||
query_contains_error: false,
|
||||
extension_fetch_task: None,
|
||||
}
|
||||
}))
|
||||
None
|
||||
}
|
||||
|
||||
fn to_item_events(event: &Self::Event, mut f: impl FnMut(workspace::item::ItemEvent)) {
|
||||
|
|
|
@ -407,10 +407,7 @@ impl PlatformInputHandler {
|
|||
}
|
||||
|
||||
pub(crate) fn flush_pending_input(&mut self, input: &str, cx: &mut WindowContext) {
|
||||
let Some(range) = self.handler.selected_text_range(cx) else {
|
||||
return;
|
||||
};
|
||||
self.handler.replace_text_in_range(Some(range), input, cx);
|
||||
self.handler.replace_text_in_range(None, input, cx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@ pub struct ExcerptId(usize);
|
|||
pub struct MultiBuffer {
|
||||
snapshot: RefCell<MultiBufferSnapshot>,
|
||||
buffers: RefCell<HashMap<BufferId, BufferState>>,
|
||||
next_excerpt_id: usize,
|
||||
subscriptions: Topic,
|
||||
singleton: bool,
|
||||
replica_id: ReplicaId,
|
||||
|
@ -232,7 +231,6 @@ impl MultiBuffer {
|
|||
Self {
|
||||
snapshot: Default::default(),
|
||||
buffers: Default::default(),
|
||||
next_excerpt_id: 1,
|
||||
subscriptions: Default::default(),
|
||||
singleton: false,
|
||||
capability,
|
||||
|
@ -272,7 +270,6 @@ impl MultiBuffer {
|
|||
Self {
|
||||
snapshot: RefCell::new(self.snapshot.borrow().clone()),
|
||||
buffers: RefCell::new(buffers),
|
||||
next_excerpt_id: 1,
|
||||
subscriptions: Default::default(),
|
||||
singleton: self.singleton,
|
||||
capability: self.capability,
|
||||
|
@ -993,7 +990,12 @@ impl MultiBuffer {
|
|||
O: text::ToOffset,
|
||||
{
|
||||
let mut ids = Vec::new();
|
||||
let mut next_excerpt_id = self.next_excerpt_id;
|
||||
let mut next_excerpt_id =
|
||||
if let Some(last_entry) = self.snapshot.borrow().excerpt_ids.last() {
|
||||
last_entry.id.0 + 1
|
||||
} else {
|
||||
1
|
||||
};
|
||||
self.insert_excerpts_with_ids_after(
|
||||
prev_excerpt_id,
|
||||
buffer,
|
||||
|
@ -1079,9 +1081,6 @@ impl MultiBuffer {
|
|||
..buffer_snapshot.anchor_after(&primary.end)
|
||||
}),
|
||||
};
|
||||
if id.0 >= self.next_excerpt_id {
|
||||
self.next_excerpt_id = id.0 + 1;
|
||||
}
|
||||
excerpts.push((id, range.clone()));
|
||||
let excerpt = Excerpt::new(
|
||||
id,
|
||||
|
@ -1093,6 +1092,10 @@ impl MultiBuffer {
|
|||
);
|
||||
new_excerpts.push(excerpt, &());
|
||||
prev_locator = locator.clone();
|
||||
|
||||
if let Some(last_mapping_entry) = new_excerpt_ids.last() {
|
||||
assert!(id > last_mapping_entry.id, "excerpt ids must be increasing");
|
||||
}
|
||||
new_excerpt_ids.push(ExcerptIdMapping { id, locator }, &());
|
||||
}
|
||||
|
||||
|
|
|
@ -116,13 +116,20 @@ pub fn update_settings_file<T: Settings>(
|
|||
store.new_text_for_update::<T>(old_text, update)
|
||||
})?;
|
||||
let initial_path = paths::SETTINGS.as_path();
|
||||
let resolved_path = fs
|
||||
.canonicalize(initial_path)
|
||||
.await
|
||||
.with_context(|| format!("Failed to canonicalize settings path {:?}", initial_path))?;
|
||||
fs.atomic_write(resolved_path.clone(), new_text)
|
||||
.await
|
||||
.with_context(|| format!("Failed to write settings to file {:?}", resolved_path))?;
|
||||
if !fs.is_file(initial_path).await {
|
||||
fs.atomic_write(initial_path.to_path_buf(), new_text)
|
||||
.await
|
||||
.with_context(|| format!("Failed to write settings to file {:?}", initial_path))?;
|
||||
} else {
|
||||
let resolved_path = fs.canonicalize(initial_path).await.with_context(|| {
|
||||
format!("Failed to canonicalize settings path {:?}", initial_path)
|
||||
})?;
|
||||
|
||||
fs.atomic_write(resolved_path.clone(), new_text)
|
||||
.await
|
||||
.with_context(|| format!("Failed to write settings to file {:?}", resolved_path))?;
|
||||
}
|
||||
|
||||
anyhow::Ok(())
|
||||
})
|
||||
.detach_and_log_err(cx);
|
||||
|
|
|
@ -118,30 +118,34 @@ impl ThemeRegistry {
|
|||
AppearanceContent::Dark => PlayerColors::dark(),
|
||||
};
|
||||
if !user_theme.style.players.is_empty() {
|
||||
player_colors = PlayerColors(
|
||||
user_theme
|
||||
.style
|
||||
.players
|
||||
.into_iter()
|
||||
.map(|player| PlayerColor {
|
||||
cursor: player
|
||||
.cursor
|
||||
.as_ref()
|
||||
.and_then(|color| try_parse_color(&color).ok())
|
||||
.unwrap_or_default(),
|
||||
background: player
|
||||
.background
|
||||
.as_ref()
|
||||
.and_then(|color| try_parse_color(&color).ok())
|
||||
.unwrap_or_default(),
|
||||
selection: player
|
||||
.selection
|
||||
.as_ref()
|
||||
.and_then(|color| try_parse_color(&color).ok())
|
||||
.unwrap_or_default(),
|
||||
})
|
||||
.collect(),
|
||||
);
|
||||
for (idx, player) in user_theme.style.players.clone().into_iter().enumerate() {
|
||||
let cursor = player
|
||||
.cursor
|
||||
.as_ref()
|
||||
.and_then(|color| try_parse_color(&color).ok());
|
||||
let background = player
|
||||
.background
|
||||
.as_ref()
|
||||
.and_then(|color| try_parse_color(&color).ok());
|
||||
let selection = player
|
||||
.selection
|
||||
.as_ref()
|
||||
.and_then(|color| try_parse_color(&color).ok());
|
||||
|
||||
if let Some(player_color) = player_colors.0.get_mut(idx) {
|
||||
*player_color = PlayerColor {
|
||||
cursor: cursor.unwrap_or(player_color.cursor),
|
||||
background: background.unwrap_or(player_color.background),
|
||||
selection: selection.unwrap_or(player_color.selection),
|
||||
};
|
||||
} else {
|
||||
player_colors.0.push(PlayerColor {
|
||||
cursor: cursor.unwrap_or_default(),
|
||||
background: background.unwrap_or_default(),
|
||||
selection: selection.unwrap_or_default(),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mut syntax_colors = match user_theme.appearance {
|
||||
|
|
|
@ -224,8 +224,8 @@ impl ContextMenu {
|
|||
.timer(Duration::from_millis(50))
|
||||
.await;
|
||||
this.update(&mut cx, |this, cx| {
|
||||
this.cancel(&menu::Cancel, cx);
|
||||
cx.dispatch_action(action);
|
||||
this.cancel(&menu::Cancel, cx)
|
||||
})
|
||||
})
|
||||
.detach_and_log_err(cx);
|
||||
|
|
|
@ -805,7 +805,7 @@ fn next_word_end(
|
|||
let mut new_point = point;
|
||||
if new_point.column() < map.line_len(new_point.row()) {
|
||||
*new_point.column_mut() += 1;
|
||||
} else if new_point.row() < map.max_buffer_row() {
|
||||
} else if new_point < map.max_point() {
|
||||
*new_point.row_mut() += 1;
|
||||
*new_point.column_mut() = 0;
|
||||
}
|
||||
|
@ -1081,13 +1081,15 @@ fn window_top(
|
|||
|
||||
if let Some(visible_rows) = text_layout_details.visible_rows {
|
||||
let bottom_row = first_visible_line.row() + visible_rows as u32;
|
||||
let new_row = (first_visible_line.row() + (times as u32)).min(bottom_row);
|
||||
let new_row = (first_visible_line.row() + (times as u32))
|
||||
.min(bottom_row)
|
||||
.min(map.max_point().row());
|
||||
let new_col = point.column().min(map.line_len(first_visible_line.row()));
|
||||
|
||||
let new_point = DisplayPoint::new(new_row, new_col);
|
||||
(map.clip_point(new_point, Bias::Left), SelectionGoal::None)
|
||||
} else {
|
||||
let new_row = first_visible_line.row() + (times as u32);
|
||||
let new_row = (first_visible_line.row() + (times as u32)).min(map.max_point().row());
|
||||
let new_col = point.column().min(map.line_len(first_visible_line.row()));
|
||||
|
||||
let new_point = DisplayPoint::new(new_row, new_col);
|
||||
|
@ -1105,8 +1107,12 @@ fn window_middle(
|
|||
.scroll_anchor
|
||||
.anchor
|
||||
.to_display_point(map);
|
||||
let max_rows = (visible_rows as u32).min(map.max_buffer_row());
|
||||
let new_row = first_visible_line.row() + (max_rows.div_euclid(2));
|
||||
|
||||
let max_visible_rows =
|
||||
(visible_rows as u32).min(map.max_point().row() - first_visible_line.row());
|
||||
|
||||
let new_row =
|
||||
(first_visible_line.row() + (max_visible_rows / 2) as u32).min(map.max_point().row());
|
||||
let new_col = point.column().min(map.line_len(new_row));
|
||||
let new_point = DisplayPoint::new(new_row, new_col);
|
||||
(map.clip_point(new_point, Bias::Left), SelectionGoal::None)
|
||||
|
@ -1128,12 +1134,12 @@ fn window_bottom(
|
|||
.to_display_point(map);
|
||||
let bottom_row = first_visible_line.row()
|
||||
+ (visible_rows + text_layout_details.scroll_anchor.offset.y - 1.).floor() as u32;
|
||||
if bottom_row < map.max_buffer_row()
|
||||
if bottom_row < map.max_point().row()
|
||||
&& text_layout_details.vertical_scroll_margin as usize > times
|
||||
{
|
||||
times = text_layout_details.vertical_scroll_margin.ceil() as usize;
|
||||
}
|
||||
let bottom_row_capped = bottom_row.min(map.max_buffer_row());
|
||||
let bottom_row_capped = bottom_row.min(map.max_point().row());
|
||||
let new_row = if bottom_row_capped.saturating_sub(times as u32) < first_visible_line.row() {
|
||||
first_visible_line.row()
|
||||
} else {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
description = "The fast, collaborative code editor."
|
||||
edition = "2021"
|
||||
name = "zed"
|
||||
version = "0.123.1"
|
||||
version = "0.123.6"
|
||||
publish = false
|
||||
license = "GPL-3.0-or-later"
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
dev
|
||||
stable
|
|
@ -249,7 +249,7 @@ impl LspAdapter for EsLintLspAdapter {
|
|||
let release = latest_github_release(
|
||||
"microsoft/vscode-eslint",
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
delegate.http_client(),
|
||||
)
|
||||
.await?;
|
||||
|
|
|
@ -36,12 +36,11 @@ function uploadDsym
|
|||
REGION="nyc3"
|
||||
file_to_upload="$1"
|
||||
file_name="$2"
|
||||
space_path="nightly"
|
||||
date=$(date +"%a, %d %b %Y %T %z")
|
||||
acl="x-amz-acl:public-read"
|
||||
content_type="application/octet-stream"
|
||||
storage_type="x-amz-storage-class:STANDARD"
|
||||
string="PUT\n\n${content_type}\n${date}\n${acl}\n${storage_type}\n/${SPACE}/${space_path}/${file_name}"
|
||||
string="PUT\n\n${content_type}\n${date}\n${acl}\n${storage_type}\n/${SPACE}/${file_name}"
|
||||
signature=$(echo -en "${string}" | openssl sha1 -hmac "${DIGITALOCEAN_SPACES_SECRET_KEY}" -binary | base64)
|
||||
|
||||
curl --fail -vv -s -X PUT -T "$file_to_upload" \
|
||||
|
@ -51,7 +50,7 @@ function uploadDsym
|
|||
-H "$storage_type" \
|
||||
-H "$acl" \
|
||||
-H "Authorization: AWS ${DIGITALOCEAN_SPACES_ACCESS_KEY}:$signature" \
|
||||
"https://${SPACE}.${REGION}.digitaloceanspaces.com/${space_path}/${file_name}"
|
||||
"https://${SPACE}.${REGION}.digitaloceanspaces.com/${file_name}"
|
||||
}
|
||||
|
||||
while getopts 'dlfoh' flag
|
||||
|
@ -142,8 +141,18 @@ if [ "$local_arch" = false ]; then
|
|||
if [ "$channel" == "nightly" ]; then
|
||||
version="$version-$(git rev-parse --short HEAD)"
|
||||
fi
|
||||
uploadDsym target/aarch64-apple-darwin/release/Zed.dwarf "$channel/Zed-$version-aarch64-apple-darwin.dwarf"
|
||||
uploadDsym target/x86_64-apple-darwin/release/Zed.dwarf "$channel/Zed-$version-x86_64-apple-darwin.dwarf"
|
||||
|
||||
echo "Removing existing gzipped dSYMs"
|
||||
rm -f target/aarch64-apple-darwin/release/Zed.dwarf.gz
|
||||
rm -f target/x86_64-apple-darwin/release/Zed.dwarf.gz
|
||||
|
||||
echo "Gzipping dSYMs"
|
||||
gzip target/aarch64-apple-darwin/release/Zed.dwarf
|
||||
gzip target/x86_64-apple-darwin/release/Zed.dwarf
|
||||
|
||||
echo "Uploading dSYMs"
|
||||
uploadDsym target/aarch64-apple-darwin/release/Zed.dwarf.gz "$channel/Zed-$version-aarch64-apple-darwin.dwarf.gz"
|
||||
uploadDsym target/x86_64-apple-darwin/release/Zed.dwarf.gz "$channel/Zed-$version-x86_64-apple-darwin.dwarf.gz"
|
||||
|
||||
echo "Creating fat binaries"
|
||||
lipo \
|
||||
|
@ -217,17 +226,17 @@ if [[ "$target_dir" = "debug" && "$local_only" = false ]]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$local_only" = true ]; then
|
||||
# If bundle_name is not set or empty, use the basename of $app_path
|
||||
if [ -z "$bundle_name" ]; then
|
||||
bundle_name=$(basename "$app_path")
|
||||
else
|
||||
# If bundle_name doesn't end in .app, append it
|
||||
if [[ "$bundle_name" != *.app ]]; then
|
||||
bundle_name="$bundle_name.app"
|
||||
fi
|
||||
# If bundle_name is not set or empty, use the basename of $app_path
|
||||
if [ -z "$bundle_name" ]; then
|
||||
bundle_name=$(basename "$app_path")
|
||||
else
|
||||
# If bundle_name doesn't end in .app, append it
|
||||
if [[ "$bundle_name" != *.app ]]; then
|
||||
bundle_name="$bundle_name.app"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$local_only" = true ]; then
|
||||
if [ "$overwrite_local_app" = true ]; then
|
||||
rm -rf "/Applications/$bundle_name"
|
||||
fi
|
||||
|
@ -240,19 +249,38 @@ if [ "$local_only" = true ]; then
|
|||
echo "/Applications/$bundle_name"
|
||||
fi
|
||||
else
|
||||
echo "Creating DMG"
|
||||
dmg_target_directory="target/${target_dir}"
|
||||
dmg_source_directory="${dmg_target_directory}/dmg"
|
||||
dmg_file_path="${dmg_target_directory}/Zed.dmg"
|
||||
xcode_bin_dir_path="$(xcode-select -p)/usr/bin"
|
||||
|
||||
rm -rf ${dmg_source_directory}
|
||||
mkdir -p ${dmg_source_directory}
|
||||
mv "${app_path}" "${dmg_source_directory}"
|
||||
|
||||
if [[ -n $MACOS_CERTIFICATE && -n $MACOS_CERTIFICATE_PASSWORD && -n $APPLE_NOTARIZATION_USERNAME && -n $APPLE_NOTARIZATION_PASSWORD ]]; then
|
||||
echo "Creating temporary DMG at ${dmg_file_path} using ${dmg_source_directory} to notarize app bundle"
|
||||
hdiutil create -volname Zed -srcfolder "${dmg_source_directory}" -ov -format UDZO "${dmg_file_path}"
|
||||
|
||||
echo "Notarizing DMG with Apple"
|
||||
"${xcode_bin_dir_path}/notarytool" submit --wait --apple-id "$APPLE_NOTARIZATION_USERNAME" --password "$APPLE_NOTARIZATION_PASSWORD" --team-id "$APPLE_NOTORIZATION_TEAM" "${dmg_file_path}"
|
||||
|
||||
echo "Removing temporary DMG (used only for notarization)"
|
||||
rm "${dmg_file_path}"
|
||||
|
||||
echo "Stapling notarization ticket to ${dmg_source_directory}/${bundle_name}"
|
||||
"${xcode_bin_dir_path}/stapler" staple "${dmg_source_directory}/${bundle_name}"
|
||||
fi
|
||||
|
||||
echo "Adding symlink to /Applications to ${dmg_source_directory}"
|
||||
ln -s /Applications ${dmg_source_directory}
|
||||
|
||||
echo "Creating final DMG at ${dmg_file_path} using ${dmg_source_directory}"
|
||||
hdiutil create -volname Zed -srcfolder "${dmg_source_directory}" -ov -format UDZO "${dmg_file_path}"
|
||||
|
||||
# If someone runs this bundle script locally, a symlink will be placed in `dmg_source_directory`.
|
||||
# This symlink causes CPU issues with Zed if the Zed codebase is the project being worked on, so we simply remove it for now.
|
||||
echo "Removing symlink to /Applications from ${dmg_source_directory}"
|
||||
rm ${dmg_source_directory}/Applications
|
||||
|
||||
echo "Adding license agreement to DMG"
|
||||
|
@ -261,7 +289,8 @@ else
|
|||
|
||||
if [[ -n $MACOS_CERTIFICATE && -n $MACOS_CERTIFICATE_PASSWORD && -n $APPLE_NOTARIZATION_USERNAME && -n $APPLE_NOTARIZATION_PASSWORD ]]; then
|
||||
echo "Notarizing DMG with Apple"
|
||||
"$(xcode-select -p)/usr/bin/notarytool" submit --wait --apple-id "$APPLE_NOTARIZATION_USERNAME" --password "$APPLE_NOTARIZATION_PASSWORD" --team-id "$APPLE_NOTORIZATION_TEAM" "${dmg_file_path}"
|
||||
"${xcode_bin_dir_path}/notarytool" submit --wait --apple-id "$APPLE_NOTARIZATION_USERNAME" --password "$APPLE_NOTARIZATION_PASSWORD" --team-id "$APPLE_NOTORIZATION_TEAM" "${dmg_file_path}"
|
||||
"${xcode_bin_dir_path}/stapler" staple "${dmg_file_path}"
|
||||
fi
|
||||
|
||||
if [ "$open_result" = true ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue